Ensure file handles in setup.py are closed