Properly reset and close the certificate store