test_runner: make end of work check stricter
This commit updates the logic that checks for the end of the test run. Prior to this change, it was possible for root.run()
to be called multiple times because of the way pending subtests were tracked. The extra calls to root.run()
were harmless, but could trigger an EventEmitter
leak warning due to 'abort'
listeners being created.