Improve sanity checks in pe_parse_certificates