Jack Gleeson, the actor who portrayed King Joffrey in Game of Thrones, has retired from acting to pursue an academic career.