Cancel lws_service before calling pthread_join