Whether he was playing a stoic starship captain in ‘Star Trek’ or a telepathic mentor figure in the ‘X-Men’ franchise, Stewart was always able to imbue his characters with depth and humanity, writes Kevin E G Perry