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>