tee.c: Added details about the freeing of orphaned sessions. session.: Added missing cases of session state into the session_state function in debug builds.