Don't add the first pkcs12 certificate multiple times
Don't add the first pkcs12 certificate multiple times

This fixes a regression introduced by commit 1d6c867. When exporting a set
of certificates to a PKCS12 file we shouldn't add the first one twice. Also
we restore historic behaviour with respect to the canames option where we
have no ee certificate with key.

Fixes #15983

Reviewed-by: David von Oheimb <fbbca6c63636e78e7034aaf1b4aa3a9736383192@siemens.com>
Reviewed-by: Tim Hudson <eb0be8e447f673b41b10eda09d63cd72526b0a42@openssl.org>
Reviewed-by: Paul Dale <ddec78389666b4f7c9b4d110380c848489a3e4aa@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16001)

openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl