Finite metapopulation models with density–dependent migration and stochastic local dynamics