A landmark agreement to control CO2 emissions from international aviation has been reached.