test_runner: reland run global after() hook earlier
This commit reverts the revert in
bb52656f. It also includes the fix for the issue that required the revert
(https://github.com/nodejs/node/pull/49059#issuecomment-1675171959) and an additional common.mustCall()
in the added test.
Refs: https://github.com/nodejs/node/pull/49059 Refs: https://github.com/nodejs/node/pull/49110