New Canaan home sells for nearly $4M