Check if item is in session before expunging.

This change makes the code not throw an error when handling an item that has
not yet been added to a session.