The spatial synchrony of species richness and its relationship to ecosystem stability