rename on Windows fails if newname already exists.