Make protothread semaphores interrupt-safe.