HPCC-12326 Fix 4 memory leaks in ESP libs

(1) memory leak inside the ReferencedFileList::
ensureFile() in workunit dll;
(2) memory leak inside the gatherLibraryNames() in
workunit dll;
(3) memory leak inside deletePkgInfo() in WsPackageProcess;
(4) memory leak inside CWsDfuEx::getFilePartsOnClusters().

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
HPCC-12326 Revise based on review comment

Signed-off-by: wangkx <kevin.wang@lexisnexis.com>
Merge pull request #6479 from wangkx/h12209b

HPCC-12326 Fix 4 memory leaks in ESP libs

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>