refactor how api tries to run the tests
refactor how api tries to run the tests

* Move the bulk of tryRun() out of the forEach into a run() method
* Bail out early to reduce nesting
* Count down to 0 rather than up to the filesCount
* Guard more explicitly against repeated tries when stats are emitted *and*
the process crashes to prevent premature test runs

andywer/ava-ts,sindresorhus/ava,Collinslenjo/ava,andywer/ava-ts,Collinslenjo/ava,avajs/ava,avajs/ava,BarryThePenguin/ava