Proposed patch to address a problem with autorepl.py
Currently autorepl.py does not waitpid() the 'zfs send' process that does the sending work. When there are a lot of replication happen in one run (with less replication tasks, this is less of a problem as init(8) would eventually wait() the processes when it adopts the orphaned zombies), this would result in one zombie per each replication.
The proposed patch tries to address this by doing an explicit waitpid() after the piped command is completed or when the pipe is broken. While I'm there also take advantage of the saved os.fork() result to eliminate an unneeded getpid() call and transfer the task of writing pid down to the parent.