Abort in Wasmtime builds without the threads cargo feature
Description
When the wasmtime crate is built without its threads cargo feature, an embedder could still enable the WebAssembly threads proposal through Config::wasm_features. A guest module that then executes memory.atomic.notify, memory.atomic.wait32 or memory.atomic.wait64 makes compiled code call a runtime function that such builds don't implement, which aborts the host process.
Details
Without the threads cargo feature, Wasmtime disables the threads proposal by default, but Config::wasm_features(WasmFeatures::THREADS, true) turned it back on and Engine::new accepted that configuration. Under this configuration memory.atomic.notify, memory.atomic.wait32 and memory.atomic.wait64 are implemented by runtime functions that only exist with the threads cargo feature. Without the Cargo feature, these functions are stubs that panic, and because they are called directly from compiled code the panic cannot unwind, so the process aborts.
Wasmtime now rejects enabling the threads proposal when the threads cargo feature is disabled: Engine::new returns an error.
Impact
Only embeddings that build the wasmtime crate with default-features = false, without the threads feature, and then enable the threads proposal through Config::wasm_features are affected. In affected builds, a guest module can abort the host process.
Embedders can work around the issue by not enabling WasmFeatures::THREADS in builds without the threads cargo feature, or by enabling the threads cargo feature.