Fix calculation of timeout on process shutdown.

When processes are shutdown they set the job timeout to a time in
the near future so the jobs are picked up again soon. However a
bug was causing the timedelta to be created in terms of days
rather than seconds as intended.

Couple of flake8 fixes as well.