locking: Move the mutex code to kernel/locking/