Add assembly code to perform lock_mutex and unlock_mutex.