Don't start sample analysis if current status is failure; first SQLAchemy work for local job tracking

The job tracking still needs to be moved into the engine_ngi submodules but this is the first example of how we will access things
good yesterday this one scared me a lot