I'll look into that case a bit this weekend if I can get the chance, I have a busy schedule right now.  My original patch did a series of renames (though it had some other issues):
http://www.winehq.org/pipermail/wine-patches/2007-February/036394.html
However, talking with Felix Nawothnig on wine-devel he suggested I re-write it, and over time his suggestions evolved into the revised form I submitted.

Erich Hoover
ehoover@mines.edu

On 4/3/07, Dan Kegel <dank@kegel.com > wrote:
Kudos for your persistance.  I hope this makes it in soon.

I see two remaining problems:

+        /*
+         * This case should never occur, we've already checked
permissions earlier
+         * and we are holding the file handle open.
+         */
+        ERR("Replacement file may not be deleted!\n");

You need to handle this case better; it happens in real
life sometimes that the filesystem lies when it tells
you you can write.  It should be a WARN, and you
need to return the proper error code.

Are you quite sure you need to do any file copying?
Wouldn't a series of renames be more efficient?
- Dan