QgsOgrProvider: fix query encoding issues