Use poll() instead of select() for the server main loop.
Fixed races with SIGCHLD handling and ptrace.
Minor fixes to timeout handling.

diff --git a/server/debugger.c b/server/debugger.c
index 683270c..fd9d8f6 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -218,7 +218,8 @@
     }
     if (timeout != -1)  /* start the timeout */
     {
-        make_timeout( &when, timeout );
+        gettimeofday( &when, 0 );
+        add_timeout( &when, timeout );
         if (!(debug_ctx->timeout = add_timeout_user( &when, wait_event_timeout, debug_ctx )))
             return 0;
     }