Lock mutex
Lock mutex, and create it in a thread-safe way if it doens't exist yet. This is useful when globals access must be protected by a mutex.
See Implementation