Work around kqueue(2) bugs on OS X in dequeue.