Refs #20847 - Fix cleanup of temporary files on failure.