(PE-5859) Strip trailing slash from remote uri

Strip the trailing slash from remote-uri-base so that repeat
slashes are not present when building the path of the
rewritten URI.