Change SIGCHLD semantics and add waiting for child process termination timeout of 5 seconds.