HPCC-9628 Eclcc hangs at end if libarchive dynamically unloaded

In my tests setup, I have the libs directory on my plugins path, meaning that
eclcc will try to load libarchive as a plugin, then unload it when it finds it
is not.

This means that MODEXIT gets called before removeFileHook (due to bugs in the
modexit logic - it should really only be called on the last unload, not on any
unload).

Protect against that event by setting lock ptr to NULL.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Merge pull request #4596 from richardkchapman/hook-lockup

HPCC-9628 Eclcc hangs at end if libarchive dynamically unloaded

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>