Implemented signal handler for child process termination.