Editorial: introduce match integrity metadata

This PR factors out the `match integrity metadata` helper algorithm from
`consume a preloaded resource`
(https://html.spec.whatwg.org/multipage/links.html#consume-a-preloaded-resource),
in preparation for https://github.com/whatwg/html/pull/12922 which will
reuse it when validating integrity metadata in `module map`.

This is a purely editorial refactoring with no observable behavior
impact.