pkcs11: Fixed issue with C_CloseAllSessions ending in an infinite loop if device was removed