Escape path queries for SQLite

Fixes #1146