Fix reference leaks in IDLE tests. Patches by Louie Lu and Terry Jan Reedy.