Fix for race condition in Mutex

This is an attempt to fix a potential race condition between creating
the mutex and assigning the security descriptor. It should be atomic
now.