Fix a bug that cause the operation queue to execute at least one operation after the queue was suspended and a operation was added to the queue.
Better internal documentation.
Fix internal thread join deadlock: When deallocating the operation queue
the queue joins its internal thread. If there are no operations
scheduled or no operation is running then the pthread_join call blocked.
The fix consists of canceling the internal thread by calling
pthread_cancel. If the join call was to be blocked then this means that
the internal thread was waiting on a condition in the
WDOperationQueuePopOperation(). The pthread_cancel has as consequence to
cancel the thread (as the pthread_cond_wait() function is a cancelation
point). If there is always an operation executing it receives a
cancelation demand.