HPCC-11861 Copying query .so files can result in truncated .so files

Use a temporary file. Also, if trying to load a corrupted dll, retry the copy
(fixing issue HPCC-11558).

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #6195 from richardkchapman/corrupt-dlls

HPCC-11861 Copying query .so files can result in truncated .so files

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>