HPCC-10546 Avoid hoisting NOT <global> as a global expression

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #5222 from ghalliday/issue10546

HPCC-10546 Avoid hoisting NOT <global> as a global expression

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>