The influence of genetic factors and population dynamics on the mating system of the hermaphroditic freshwater snail Biomphalaria pfeifferi