Partial functional differential equation with an integral condition and applications to population dynamics