rustc: Don't panic on corrupt metadata

Fix a panic where the compiler was looking at stale or old metadata.

See #19798, #19772, #19757, #19744, #19718, #19691.
Merge pull request #19799 from alexcrichton/stop-panicking

rustc: Don't panic on corrupt metadata

Reviewed-by: huonw