fix some semaphore wait semantics (race condition deadlock and error checking)
[musl] / src / setjmp / longjmp.c