handle duplicate slashes in case of reverse proxy configuration

Conflicts:
	tests/lib/request.php
in case uri and script name don't match we better throw an exception
fixes #6050
fixing failing unit test
Merge pull request #6042 from owncloud/backport-6035-oc5

Backport 6035 oc5