Refactor: cib: Avoid holding open the file we are renaming