improve deadlock detecter and unlock exception handler; minor fixes in genbeans.lua; update mapdb