[Python-checkins] [2.7] bpo-34120: fix IDLE freezing after closing dialogs (GH-8603)