Add `testTeardown` logging callback.

This is primarily useful as a way of making global checks that can fail
tests, for example checking that any XMLHttpRequest initiated during a test
finishes before the next test.

@Cyril-Sf and I have found this useful.  What do others think?