HPCC-12563 Clean up scheduling workunits that are failed then deleted

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

HPCC-12563 Clean up scheduling workunits that are failed then deleted

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>