test_runner: run global after() hook earlier
This commit moves the global after()
hook execution from the 'beforeExit'
event to the point where all tests have finished running. This gives the global after()
a chance to clean up handles that would otherwise prevent the 'beforeExit'
event from being emitted.