Feedback control of birth and death rates for optimal population density