Improved SIGCHLD handling