catastrophic renaming bug fix

Unlike what the documentation (and the error message) says, files
got renamed even if that would overwrite an existing file.

Apparently it has been like that since the Python rewrite many
years ago (5f4ba7d and thereabout).