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