Habitat stability affects dispersal and the ability to track climate change