Such that wasm cannot crash us by passing wrong object refs.
https://github.com/bytecodealliance/wasm-micro-runtime/discussions/1987
It still is unsafe if some code in the process other than HarfBuzz
registers refs with wasm-micro-runtime, since wasm_externref_ref2obj()
takes no context variable and looks up refs globally :(.
Maybe I fix that later by keeping a hash table of ref->obj-type instead.