mail(1): Bring some fixes from other BSDs.
Fix missing forked job changes from r302776 in wait_child().
Obtained from: NetBSD