Wrap access to register lock in mutex.