This is definitely a catch 22 situation. On one hand the security door is meant to keep intruders out. It was never designed to keep the pilot out when co pilot goes suicidal. If you have some keypad to open the door. Then hijackers can hold a gun to the stewards head and say open it or die. The only solution I can think of is to have a remote entry lock. Where the air traffic controller can verify the situation and remotely unlock the door, if the situation warrants it.