Use wait4 instead of waitpid. This makes it possible to get resource
usage information from the child that exited. The user and system time
is printed out for curious developer to inspect.
If a child happens to be stopped or continued, we are now ignoring
those state changes. This prevents zombie processes to be left in case
something special happens to the child.
Further improvement is that it is possible to tell whether the child
was killed with some signal or if it exited with a code.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>