fix URI parsing to support spaces in path

Ran across this while trying to close an Atlas ticket. Same issue as https://github.com/mapbox/node-mbtiles/pull/45. Tests fail without fix when run in a path with a space, pass with it.