Separate get_session_info between HistoryAccessor and HistoryManager

HistoryAccessor has no concept of the current session, whereas
HistoryManager does. HistoryAccessor should therefore always be used
with a session number > 0. However, I have added get_last_session_id()
to HistoryAccessor to make it easier to work with recent history.

Closes gh-5348
Merge pull request #5426 from takluyver/i5348

Separate get_session_info between HistoryAccessor and HistoryManager