Limit of spin squeezing in trapped Bose-Einstein condensates