Revert "semaphore: Remove mutex emulation"

This reverts commit 4882720b267b7b1d1b0ce08334b205f0329d4615.

Signed-off-by: garwedgess <garethwilliams21@gmail.com>