interface/thread: ThreadLocalKey: Thread-local storage
server/state: Use thread-local storage to find out caller module in access_module()
server/state: Check that modules are accessed according to dependencies to avoid deadlocks