Costs of dispersal alter optimal offspring size in patchy habitats: combining theory and data for a marine invertebrate