Postgrsql-related fixes

- Prevent backslash from tripping logging with PostgreSQL fixes habari/habari#527
- Fix comments overview query on admin dashboard for PostgreSQL fixes habari/habari#384 - Tested with postgresql and sqlite