message_handler: Hold the session instance

The message_handler was using `getSession()` to get the session of the
handler.

The session instance is valid until the handler is completed, so in
reality, it is reasonable for the handler to own the session instance.

In the ipmi stress test, it's found an issue that the session is marked
as inactive and gets removed from sessions_manager before the handler is
completed, so the `getSession()` will throw in `~Handler()` and an error
log is printed:

 Async RMCP+ reply failed

The session at that time is actually valid.
Let the handler hold the session instance and do not call `getSession()`
every time it uses the session, so that it does not need to call
session_manager's `getSession()` in `~Handler()`.

There are cases that the Handler is created without calling
`updSessionData()`, inititalize the session in its constructor in such
cases.

Note that there will be following commits to address the `getSession()`
issue in others places.

Tested: With the following commits, there is no "Async RMCP+ reply
        failed" logs anymore.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Ief4cbf0237605f7a9b38d59acae42c86f046f792
2 files changed