make the mutex a context manager