Resolve symlink of target directory

`isManaged` function has resolved symlink of `path`. I think that should also resolve `target`.

This patch fixes #6774.