S/MIME: Canonicalize multi-part messages before hashing. Improve error checking in wc_MIME_parse_headers.