For Former MI5 Head, Real Life Inspires Spy Novels