minor tweaks
don't use pthread_cancel() but use a boolean flag to instead

pthread_cancel() can interrupt the running thread anytime
(unless cancellation points are esplicitly handled) which means
it might leave while a lock was retained , blocking the destruction phase.
Using a boolean flag accessed using the atomic builtins is enough
since we anyway want to wait until iomux_run() has finished its job