HPCC-12031 Always throw exceptions if cannot allocate enough memory

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

HPCC-12031 Always throw exceptions if cannot allocate enough memory

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>