AttestationToPayloadJSON parses the attestation and checks that the
predicate type matches the expected type provided by the user.
Previously, when this function was called for old-format bundles and
detached signatures, any error returned was silently ignored, so
malformed attestations would be accepted and cosign would report a
successful verification. For new-format bundles, this check was never
performed at all, so the attestaion would be accepted even if it did not
match the type given by the user. This change ensures that errors are
handled correctly and that the check is performed for both paths.
Signed-off-by: Colleen Murphy <colleenmurphy@google.com>