quote_path: fix collapsing of relative paths