replace only the first occurrence of the root_path

if someone pushed an image with the name 'stackbrew/registry'
and their root_path was set to '/registry', this would replace
both occurrences in the string. This fix only replaces the first
occurrence of the string, which should only be the root_path.
Merge branch '172-fix-swift-backend' of github.com:bacongobbler/docker-registry into 172-fix-swift-backend