A transatlantic flight was forced to divert to the Republic of Ireland because a pilot spilled a cup of coffee on the aircraft's controls.