Fix cancellation of gpgme without pthread_cancel.