[Verifier] Use worklist to verify metadata (#196461)
This patch switches from using recursive descent to verify metadata to
using a worklist. This change is motivated by the fact that we ran into
some stackoverflows in this code while loading some reasonably large
bitcode modules from an internal server application (i.e., real world
code) within fibers that have somewhat limited stack space. We of course
can get around this by just increasing the stack limit of the fibers,
but this seemed easy enough and the proper way to do things.
This implementation is mine, but I did a preliminary implementation
using Gemini inside of Windsurf.