check-mlir target run tests simultaneously with multiple threads. This caused multiple threads to invoke the lld::elf::link() interface at the same time. Since the interface does not have a thread-safe implementation, add a metex to prevent multi-threaded access.
I discovered this by looking the the failure stack trace. lld/ELF/symbolTable.cpp, SymbolTable::insert() hit into an assert with related to Epoch Trackers. The root cause is to due to there is no protection around the symMap (update) who is implemented by denseMap and is not thread safe.