Viability analysis for endangered metapopulations : a diffusion approximation approach