Avoid slow copies clashing when copying build.log

There's still a race between the unlink and the rename, if the OS'
rename() doesn't support overwriting existing files.