[LinkerWrapper] Fix memory issues due to unguarded accesses to global state
There were intemittent errors in the linker wrapper when using the
sanitizers in parallel. First, this is because the `TempFiles` global
was not guarded when creating a new file. Second, even though the `Args`
list is passed as const, the internal state is mutable when adding a
string. So that needs to be guarded too.
Fixes https://github.com/llvm/llvm-project/issues/60437
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D142985