we can take the permission directly from the share, no need to call the share api first
Fix endless loop on windows servers

Directory seperator is \ on windows
However we can just check for path != dirname(path) because that is
the same for '' (empty string), '.' and DIRECTORY_SEPARATOR on all OS
remove error_log output
Merge branch 'sharing_cleanup' of github.com:owncloud/core into sharing_cleanup
Merge pull request #8497 from owncloud/sharing_cleanup

[sharing] some small clean ups and bug fixes