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.

diff --git a/server/thread.c b/server/thread.c
index 2b53d59..1a9244f 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -108,7 +108,7 @@
 {
     int i;
 
-    thread->unix_pid        = 0;  /* not known yet */
+    thread->unix_pid        = -1;  /* not known yet */
     thread->context         = NULL;
     thread->teb             = NULL;
     thread->mutex           = NULL;
@@ -814,7 +814,7 @@
     int reply_fd = thread_get_inflight_fd( current, req->reply_fd );
     int wait_fd = thread_get_inflight_fd( current, req->wait_fd );
 
-    if (current->unix_pid)
+    if (current->unix_pid != -1)
     {
         fatal_protocol_error( current, "init_thread: already running\n" );
         goto error;