[Python-Dev] Better module shutdown procedure