Use realpath to resolve symlinks

Fixes https://github.com/owncloud/core/issues/9709