HAL_Linux: use pthread mutexes for semaphores