The writer knows ‘how, why, when and where’ Gary Oldman’s cantankerous intelligence officer meets his end – a fate he figured out ‘relatively recently’