thread: Test for pending cancellation requests before poll()ing on OS X