Make "main_loop" actually the main loop

In the spirit of "leave it better" this removes the
not-actually-main-loop "main_loop()" and replaces its contents with the
contents of get_job, which actually was the main loop.

This has the benefit of being a bit cleaner around the logic of when we
check for whether to quit or re-exec ourselves with a new version of
code.

Change-Id: I14f8c1113d303da8512d5d69715ee658ae3fde72
Reviewed-on: http://gerrit.causes.com/44520
Reviewed-by: Tom Dooner <tom.dooner@brigade.com>
Tested-by: Tom Dooner <tom.dooner@brigade.com>