parlib: Implement uthread mutexes with semaphores