Cleaned up user_mutex_lock function

- The body of "user_mutex_lock" has been refactored to make it more
  readable.