[rewheel] Explicitly close open files

Python test suite complains with "ResourceWarning: unclosed file"
when this isn't done.