HPCC-12198 Abort parsing earlier for invalid queries

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>