Cleanup: set job state to cancelled in a different place.