In case of a boxed vector, `wasm_$name_vec_delete` now checks that the
vec is correctly initialized (by checking the first item only) because
transmuting `Vec<*mut T>` to `Vec<Box<T>>`, otherwise it will crash.
This patch does several things:
1. It applies our Rust patterns for C API by replacing the raw pointer
by `Option<Box<T>>`,
2. It allows `wasm_$name_vec_delete` to handle null pointer,
3. Because it takes ownership of the `wasm_$name_vec_t`, the pointer
is correctly dropped (which fix the memory leak).
We have known memory leaks with extern types. The idea is to change
the code so that extern types can hold/own data. This patch does that.
A `wasm_externtype_t` holds a `WasmExternType` enum. This enum owns
sibling types such as `WasmFunctionType`, `WasmGlobalType`,
`WasmTableType` and `WasmMemoryType`. It is those structures that ows
the extern types data, like `params` and `results` as
`wasm_valtype_vec_t` for `WasmFunctionType`. That way, for example,
`wasm_functype_t` can return a pointer to these vec which it owns.
A `wasm_externtype_t` continues to be transmuted to `wasm_functype_t`
etc. Nothing changes on that side.