Fix mem leaks and allow missing pkey and/or cert in try_decode_PKCS12()