HPCC-10020 Optimize IF(EXISTS(x), x) to x

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