Allow duplicate certs in ssl_build_cert_chain

X509_STORE_add_cert fails when the certificate is already in the store. This bugfix allows ssl_build_cert_chain to fix chains that contain duplicate certificates.