Until recently, the idea that the world's most powerful nations might come together to tackle global warming seemed an environmentalist's pipe dream.