Struct that implements the ModeWrapper and Invoker
traits for any type that borrows MutexSync and a specific key. Enables using
MutexSync as a ModeWrapper or Invoker.
Struct that holds the mutex used for synchronisation and manages removing itself from the
containing map once no longer referenced by any threads. Removes itself from the map when
decrementing the counter from 1 to 0 and makes sure that the counter cannot be incremented
back up once reaching 0 in case a thread finds a ReferenceCountedMutex that is in the
process of being removed from the map.