Wrap file exists test in file opening context manager

IIRC when using open as a context manager the file handle is closed when
you leave the scope of the context manager. While the file should still
exist I'm not sure how Travis' architecture deals with this. I should
probably try a temp file out too...