An American airline pilot was caught with two bottles of Jägermeister – one opened and only half full – as he prepared to fly a Boeing 767 from Edinburgh to New York, a court has been told.