Fixes to #51 and #52

Here are the fixes.
Note that, because `save_shell_history` it is a separate function, it redoes much of the work of `dump_panes`. This includes both querying the tmux, and retrieving full command from `ps`. Do you think this is worth merging into single method to deduplicate the work? I have tried saving a large session (~30 panes), and delay was not large, but noticeable.