Dispersal and stability in metapopulations