Cleanup control flow in main loop

removes some complexity that was introduced with the fix to kill
timed-out child processes