Fix issues where doubly prefixed would fail

On case-sensitive file systems doubly prefixed paths would fail as the
generated path would be `Browse\assets` instead of `Browse\Assets`.

Refs #5166
Add test for URL generation with multiple prefxies.
Merge pull request #5171 from cakephp/issue-5166

Fix issues where doubly prefixed would fail