Merge pull request #624 from JensErat/locking

[FIX] Enforce DBLOCKING=true for locking tests
[FIX] Core, Locking: fix semi-global lock when no database is opened