'Try to reap a process (without blocking) via waitpid.
This is called when sigchild is caught or a Process object loses its
"connection" (stdout is closed) This ought to result in reaping all
zombie processes, since it will be called twice as often as it needs
to be.
(Unfortunately, this is a slightly experimental approach, since
UNIX has no way to be really sure that your process is going to
go away w/o blocking.  I don\'t want to block.)'

def reapProcess(self):

    try:
        try:
            (pid, status) = os.waitpid(self.pid, os.WNOHANG)
        except OSError as e:
            if (e.errno == errno.ECHILD):
                pid = None
            else:
                raise
    except:
        log.msg(('Failed    to    reap    %d:' % self.pid))
        log.err()
        pid = None
    if pid:
        self.processEnded(status)
        unregisterReapProcessHandler(pid, self)
