MFC r208489,r216208: sh: Reap any zombies before forking for a background
command.
This prevents accumulating huge amounts of zombies if a script executes
many background commands but no external commands or subshells.
Note that zombies will not be reaped during long calculations (within
the shell process) or read builtins, but those actions do not create
more zombies.
The terminated background commands will also still be remembered by the
shell.
r216208 fixes a bug in r208489 that could cause a multi-command pipeline to
be marked as done before all processes had been created.
PR: bin/55346
git-svn-id: svn://svn.freebsd.org/base/stable/8@222208
ccf9f872-aa2e-dd11-9fc8-
001c23d0bc1f