make non-waiting paths of sem_[timed]wait and pthread_join cancelable