Avoid usage of temporary file to write symlink.

Creating a symlink is an atomic operation, and additionally
usage of tmp file + rename performs very badly on NTFS file
system because of the way the rename is tracked in the $MFT.

In case symbolic links are not supported, we still fallback to
a regular file.