Implemented lock_mutex and unlock_mutex. WFE/WFI not used due to QEMU doesn't support.