bpo-33760: Fix file leaks in test_io. (GH-7361) (GH-7370)

(cherry picked from commit e36837cb71032ccfa713e75623b314f091dc22bb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 file changed