Fix crash when file/dir renaming is failed