Don't crash if send_thread_wakeup() fails.

diff --git a/server/thread.c b/server/thread.c
index 90e88aa..918c842 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -440,7 +440,8 @@
         if (debug_level) fprintf( stderr, "%08x: *wakeup* signaled=%d cookie=%p\n",
                                   (unsigned int)thread, signaled, cookie );
         end_wait( thread );
-        send_thread_wakeup( thread, cookie, signaled );
+        if (send_thread_wakeup( thread, cookie, signaled ) == -1) /* error */
+	    break;
     }
     return count;
 }