Add ENOLINK define for Windows.

It is needed in order to test return values from safe_open, but it
will never actually be returned by safe_open on Windows, since it is
only a very thin wrapper there.
Redmine #6570: Improve error messages when encountering unsafe links.

Change the return code when we encounter unsafe symlinks so that the
message in general is more understandable. We're forced to use errno
codes, which doesn't give us the greatest selection, but ENOLINK
('Link has been severed') seems like the best one.
Detect when open fails due to an already existing file in safe_open.

This is in order to give better error messages based on the error
code.

Redmine #6570.
Improve error message when trying to create a file over dangling link.

Also improve the error message for the case where we want to access a
file using a file promise, inside a directory to which the path
contains an unsafe symlink.

Redmine #6570.
Merge pull request #1989 from kacfengine/ENOLINK_fix

Redmine #6570: Improve error messages when encountering unsafe links.