[autotest] Fix missing execution_subdir for hostless jobs

The status of hostless jobs is set to Starting in schedule_new_jobs.
If the scheduler is interrupted after doing that, it will try to
restore the agents after a starting again. The execution_subdir is
not set at that point though. Therefore an assertion will fail and
an exception will be raised.

Before this commit, the execution_subdir is set to 'hostless'  in the
prolog of hostless jobs. This commit moves this also to
start_new_jobs, before setting the status, so when the status is set
to Starting, the execution subdir will always be already set.

In case the scheduler is interrupted after setting the
execution_subdir but before setting the status, nothing bad will
happen as the execution_subdir is never accessed if the status isn't
Starting, Running, Gathering, Parsing or Archiving.

BUG=chromium:334353
DEPLOY=scheduler
TEST=Ran utils/unittest_suite.py and manually killed+restarted scheduler

Change-Id: I048bf18883857d6ff5016ace64526729f631bc26
Reviewed-on: https://chromium-review.googlesource.com/215394
Reviewed-by: Prashanth B <beeps@chromium.org>
Commit-Queue: Jakob Jülich <jakobjuelich@chromium.org>
Tested-by: Jakob Jülich <jakobjuelich@chromium.org>
2 files changed