How are POSIX cancellation points supposed to behave?
Isn't this clarified in the next paragraph of the standard:
However, if the thread is suspended at a cancellation point and the event for which it is waiting occurs before the cancellation request is acted upon, it is unspecified whether the cancellation request is acted upon or whether the cancellation request remains pending and the thread resumes normal execution.
Which implies that this race condition is perfectly legal behaviour.