When using multiple threads, termination flags are checked to stop the thread if a `proc_exit` or trap occurs. They have to be set also in debug mode. Tested using [WASI thread tests](https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/core/iwasm/libraries/lib-wasi-threads/test).