Redmine#2753: do not call readlink() on a directory to avoid spurious error message