pki: Properly clean up if output format for --pkcs12 is wrong