Fix memory leak: It can be cases where the key has not been set
and the calling code just wants to recycle the key. Also, the
algorithm code does not have ownership of the key. The current
design is that you first must recycle the key and then the
algorithm.
Fix memory leak: The symmetric key can be set both for mac and
symmetric algorithms. If we do not set it in the session, then
it will not be deleted once the operation is finished.