Hi Paul,
I've sent a patch (multiple times since it hasn't been reviewed, unfortunately) for the same bug and, while it didn't add the (trivial) tests, I believe it handled some extra corner cases, which you might want to add.
See: https://source.winehq.org/patches/data/184165
In particular, I'm concerned what happens with your patch if the file itself is either moved, deleted, or refers to something special (like bash's pipe:[12345678] for example), since you don't test the resulted filename at all—and it might not be the same file.
Also it would be nice to add an implementation with #elif defined(F_GETPATH) for other Unix platforms or MacOS (you can look at my patch for trivial example, but I haven't tested it).
And lastly we have a bug on bugzilla about it already:
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46070
Thanks, Gabriel