Assorted fixes for backups in OFile

Fixes these problems in backup of output files
     - can't rename an open file under windows due to stricter locking
     - prints reason in case of failure failure
     - removed leak of FILE*s