Countries finalise historic pandemic agreement after three years of negotiations