Historical path-dependence of the urban population density gradient