lib/runcmd: Create a separate process group when spawning jobs

This has no major impact on performance, but it does mean that a
worker can control and wait() for any and all programs spawned by
whatever processes it fires up to do the actual work.

Signed-off-by: Andreas Ericsson <ae@op5.se>
lib/worker: Utilize process groups when controlling and reaping jobs

When a job exits nicely (as should be the most common thing), we
don't do any extra work at all. When we're forced to kill one
though, we'll signal all processes in the child's process group
and then attempt to reap all those children in order to avoid a
buildup of zombies.

We use a 5ms busy-loop to reap the children, where each failure to
wait() that doesn't trigger an error (such as ECHILD) is considered
worthy of a 1ms sleep and a retry.

Note that this is a best-effort thing however. Processes stuck in
uninterruptable I/O will still, in all likelihood, become zombies.

Signed-off-by: Andreas Ericsson <ae@op5.se>