[FIX] Core, Locking: fix semi-global lock when no database is opened
Merge pull request #625 from JensErat/locking

[FIX] Core, Locking: fix semi-global lock when no database is opened