Greater biodiversity makes ecosystems more resistant to climate change