bpo-36405: IDLE - Restore __main__ and add tests (#12518)

Fix error in commit 2b75155 noticed by Serhiy Storchaka.
5 files changed