bpo-40275: Avoid importing logging in test.support (GH-19601)

Import logging lazily in assertLogs() in unittest.
Move TestHandler from test.support to logging_helper.
7 files changed