Simple solution, digital locks that are able to be activated either by the cabin crew manually, or by the pilot automatically as a result of some controls that indicate there is a problem.
Anytime a programmer sees a non-technological issue, they think "I know, I'll use computers!" Now they have two problems. (With apologies to JZ et al.)