After concerns climate talks in Baku could collapse, the gavel came down on a finance deal in the early hours of the morning.