shorten_path: Escape '%' instead of using a var

When ${var//orig/replace} is intended with orig as '%' there is no need
to use a variable to avoid the '//%' form if the '%' is escaped.