Enable closing the session and usage as a context manager