refactored LockingMessageDispatcher to a hook, tried to fix the MutexLockProvider and added unit tests for it