Properly report errors when renaming a file

That is especially usefull when renaming to an existing file with a different case