Added send_thread_signal() function and properly handle errors caused
by the thread having already died when we send it a signal.
Use -1 instead of 0 as invalid Unix pid value.

6 files changed