The default pthread cancellation type is deferred. Check that the canceltype is asynchronous (with respect to cancellation points) before cancelling a thread. Signed-off-by: Christopher Friedt <cfriedt@meta.com>