Closes the session.
Don't forget to call this when the session is no longer needed, to avoid leaking resources.