Correct file cleanup, Python 2.4-compatible

Amends e532cb1954