Some state management fixes. Don't set state to running if we crashed.
Discard job if its project is gone.