Silence py3 warnings about files left open.

This isn't an exhaustive list, nor is it necessarily safe against
exceptions, but it does suffice for me in "normal operations."

Adding exception safe versions would be quite tiresome, as Python 2.4
does not have a try-except-finally block (only try-except and try-finally).
The code, if were to go down that road, would be:

    f = open(...)
    try:
        try:
            # use f here
        except:
            # handle exceptions
    finally:
        f.close()