mktorrent: fixing the usual pthread_cancel problem