Public goods games in populations with fluctuating size.