avoid using signals when a thread attempts to cancel itself

not only is pthread_kill expensive in this case; it also breaks
testing under qemu app-level emulation.
1 file changed