Ensure file handle is closed using with statement

This change ensures the file in `setup.py` is closed by using the with statement.