bpo-31234: test_threaded_import: fix test_side_effect_import() (#3189)

* Don't leak the module into sys.modules
* Avoid dangling thread
1 file changed