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>
Merge remote-tracking branch 'origin/candidate-4.2.6' into closedown-4.2.x

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge branch 'closedown-4.2.x' into candidate-4.2.8

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>