POSIX requires that renameat(fd,"symlink-to-dir/",fd,"dir2") rename
dir and leave symlink-to-dir dangling; likewise, it
requires that renameat(fd,"dir",fd,"dangling/") rename dir so
that dangling is no longer a dangling symlink. This behavior
is counter-intuitive, so on some systems, renameat fails with
ENOTDIR if either argument is a symlink with a trailing slash:
glibc, OpenBSD, Cygwin 1.7.

After renaming a non-empty directory over an existing empty directory,
the old directory name is still visible through the stat function
for 30 seconds after the rename, on NFS file systems, on some platforms:
Linux 2.6.18.

This function will not rename a source that is currently opened
by any process:
mingw, MSVC 9.