test-lib: introduce 'test_atexit'