“Imagine if the pilot would have been armed. I would have gotten thru a locked door with my firearm.”
A kill switch would have been far more effective. Every copilot needs to have a kill switch embedded, so the captain has full control, even if he is out of the cockpit.
Here is one: Laputan machine.
But of course your proposition suffers from at least one problem: what if it's the captain who is crazy, and not the copilot?
There is only one verifiably correct solution, and that is to remove humans from the control loop altogether. The cockpit is sealed and nobody ever enters there. The airplane is flown only by computers that are guided by ATC over encrypted radio links, but are perfectly capable of landing on their own at any airport in case of trouble. I understand that it will make some rare saves by human pilots impossible; however it will eliminate a much larger number of common pilot errors. Rare a pilot is skilled enough to land a damaged airplane into the river, and it is rarely needed; however there are many pilots who fail to visually land a perfectly good airplane in perfectly good weather for one reason or another.