Andrei Karlov, the Russian ambassador to Turkey who was shot dead in an art gallery on Monday, was a veteran diplomat who had spent much of his career in Moscow and had taken up the job in Ankara in the summer of 2013.