improve/debloat mutex unlock error checking in pthread_cond_wait