rename file without changing mtime

Renaming a file currently changes its mtime, since the file gets deleted and recreated. It shouldn't do that. Here's the fix.