Transaction-safe condition variables (not a drop-in replacement for pthread_cond_t)