refactored the Mutex#Lock. made the mutex test unlock everything upon exit