Prevent possible deadlock in singletons handling

By giving each singleton its own mutex, we remove a possible deadlock in the
singleton instantiation.