[WebAssembly] Cooperative threading for WASIP3 (#200855)
This PR builds on the changes to allow libcall thread context from
https://github.com/llvm/llvm-project/pull/175800/changes and adds the
necessary changes to support cooperative multithreading in the WASIP3
target:
- Not marking memory as shared
- Allowing thread local accesses without atomics
- Only using passive segments for TLS segments
The linker changes are supported by a new flag called
`--cooperative-multithreading`. We talked about having two flags, one
for the `--libcall-thread-context` part and one for the cooperative
multithreading part. For now, I've simply replaced the
`--libcall-thread-context` flag with the `--cooperative-multithreading`
one and kept the internal configuration intact for simplicity.