Use context managers properly for tempfiles
Use context managers properly for tempfiles

The directory will be removed unconditionally, so it has a context
manager.

The old filelist is copied into a mkstemp so that it will be left behind if
something goes wrong during the update process.

rlee287/pyautoupdate,rlee287/pyautoupdate