Delay job sending finished notification mail

We have been running into the problem that the finished time in
notification mails was given as "None" sometimes, presumably because the
task for sending it started running before the original transaction to
set the job state was fully committed.

This commit will hopefully fix that.
Merge pull request #294 from guidow/delay_job_finished_mail

Delay sending job finished notification mail