Fix SIGCHLD/signal.pause timing bug.

If the child exits before the parent gets to signal.pause, the
parent will never get a chance to continue.  This rewrites it to
call os.wait4 until it does not get interrupted by a signal, fixing
the timing-bug.