bpo-42208: Move _PyImport_Cleanup() to pylifecycle.c (GH-23040)

Move _PyImport_Cleanup() to pylifecycle.c, rename it to
finalize_modules(), split it (200 lines) into many smaller
sub-functions and cleanup the code.
2 files changed