[TAV-349] Improved run cancelling.

If a run is cancelled before it starts to actually run then it can just be
deleted from the job queue instead. This frees up a space in the queue and is
a cleaner way of handling this stuff.

Race conditions are prevented by checking the running status of the job itself
in a transaction.