HPCC-10552 Fix regression calling close(-1) (caught in windows debug)

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

HPCC-10552 Fix regression calling close(-1) (caught in windows debug)

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>