Ensure file handles are closed in setup.py

This change ensures the file handles are closed properly in setup.py.
I was going to use the with statement but then I saw Python 2.6 is in the list of supported versions, so can't be used.