Pardon me if this is already done, but perhaps the addition of a sentence in the emergency QRH, assuming such a thing exists, to the effect of 'ensure cockpit door unlocked' would help in the case of normal emergency situations?
There are lots of situations that could be engineered by bad guys just for that purpose.
Leaving it unlocked in an emergency should be a judgement call, not an automatic process. Good judgement is what Captains get paid for.