Spring-load the lock. The lock remains unlocked only so long as you hold the key turned. Furthermore, make it so it can't unlock if there is any tension on the door. (Make the bolt with a head that's bigger than the shaft. This goes into a hole with a solid outer part and then an inner part...