Bug 943174 - Avoid waitpid on already-reaped content processes. r=bsmedberg a=lsblakk

Includes fix for bug 989042 (BSD build breakage caused by m-c patch for
bug 943174).