Don't crash if queuing an APC on a thread that doesn't wait.

diff --git a/server/thread.c b/server/thread.c
index e86cd6d..d184f04 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -511,7 +511,7 @@
     thread->apc[thread->apc_count].func  = func;
     thread->apc[thread->apc_count].param = param;
     thread->apc_count++;
-    wake_thread( thread );
+    if (thread->wait) wake_thread( thread );
     return 1;
 }