handle OSes where you can't rename a open file in the cleanup code.