Ensure file handle is closed by using with statement

Ensure the file handle in `setup.py` is automatically closed.