Revert "Revert "Make the linker API thread-safe""

Also includes a fix for the segfaults on Windows caused by the original
version of this patch.

This reverts commit 4b51194df4090d984f02c12128e868077660fb8b.
Revert "Revert "Add purgeObj() to remove the symbol table entries for an object""

This reverts commit 7932b2adaecac6c86038176d909c20ad1b1f9604.
Disable T8124 on Windows (uses pthreads)