Fix use of uninitialized mutex reported by thread sanitizer:
This branch fixes an invalid access to a mutex object. See the error message from gcc's thread sanitizer below: WARNING: ThreadSanitizer: use of an invalid mutex (e.g. uninitialized or destroyed)