Only compare with PTHREAD_CANCELED if defined.