Fix bug when handling URLs with spaces

Because `-[NSURL path]` returns a string that's already been unescaped, but the code expects `path` to be percent-escaped, having spaces in the URL used to break things. This is the simplest fix; we just take the unescaped path and re-escape it.