xb-main: reorder checks

This will be useful in the next commit.
xb-main: unescape the path we get in the query

Paths will typically be passed-in escaped in the query. Make sure we
unescape them.
tests: escape paths before passing them to the bridge

Should fix test failures seen on OBS.