Avoid reusing object handles after logout
During implementation of the smart cards CI, I noticed this issue when the SoftHSM is used as a pkcs11 module in NSS DB.
It looks like reusing the SECPrivateKey
objects after logout is not valid so we should handle this problem appropriately in the attempt to sign data as described in the mozilla bug [1].
This is nothing that should prevent libcacard working in general use cases, but this is preventing using libcacard for testing OpenSC (and vice versa).
This MR contains also a minimal reproduced, which correctly fails before the fix is applied.