[NFC] Deduplicate imported global parsing (#4678)
[NFC] Deduplicate imported global parsing (#4678)

Share the logic for parsing imported and non-imported globals of the formats:

  (import "module" "base" (global $name? type))

  (global $name? type init)

This fixes #4676, since the deleted logic for parsing imported globals did not
handle parsing GC types correctly.
WebAssembly/binaryen,WebAssembly/binaryen,WebAssembly/binaryen,WebAssembly/binaryen,WebAssembly/binaryen