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.