The evolution of density-dependent dispersal