Revert "semaphore: Remove mutex emulation"