No Rambo's need apply.
Have you ever wondered why the bank doesn't station a guard inside the vault at night? It's because the vault, for all intents and purposes, is made impenetrable when it is locked. The same needs to be done with the cockpit door.
I'm sorry if my irony wasn't apparent. Again, the question was: why a gun in the cockpit with a locked armoured door?