jobd.pl: never return from exec_job_command in the child
If exec_job_command returns when it's running in the child
of the fork, then essentially two copies of jobd.pl will start
running at that point leading to all kinds of havoc.
This could only happen if the redirect of stdin/stdout to /dev/null
failed or the setpgid call failed.
Normally none of these ever fail. However, under unusual circumstances
the setpgid call may fail temporarily. If this happens, the child
MUST NOT return as that will essentially create multiple jobd.pl
processes. Instead the child MUST always exit with an error code
if a problem occurs before the child's process is replaced with the
'exec' process.
Also make sure the child exits with a non-zero value, that such an
exit triggers 'on_error' instead of 'on_success' and improve the
race condition issue by setting finished to 0 before the fork and
moving the "prevent races" delay to before any possible error exits.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>