More to the point, if the cockpit door really is unbreakable, then any terrorist who manages to get even momentary control of the cockpit via any means will be completely unstoppable. By contrast, if the pilot is armed and the cockpit door is of a design that takes a minute or so to break down, then even a terrorist who takes out a pilot would have to worry that once the door breaks down he's only got a certain amount of ammo--not enough bullets to stop all the attackers.