Memory leak fixes for file handling.

Add explicit close to obsolete file handle on read()
Add __enter__ and __exit__ methods so class can be used as a context manager.
Merge pull request #7 from pygraphviz/context-file

Memory leak fixes for file handling.