Mutex::~Mutex() now waits for unlock to prevent data corruption