Fix tracking of selected dives across sort column changes

With  commit 800b0482f39e ("When switching sort order, scroll the dive
list to the current dive") we introduced an unwanted new behavior. When
changing sort columns we could lose all selections except for the main
"selected_dive". This was caused by the call to gtk_tree_view_set_cursor
on the selected_dive which unselected all other dives.

As a side-effect this also fixed another bug that was introduced by the
same change: shift-cursor-up and -down now works again to select multiple
dives with the keyboard.

But fixing that bug unearthed a different issue. Our code that restored
the selection state of the tree model oddly decided to mark a divetrip as
selected if its first child was selected. The bug above masked that by
immediately unselecting the trip again, but now that this was fixed the
problem was immediately obvious: we would start with both the first trip
and the first dive in that trip selected (well, since we are in reverse
order it's actually the chronologically last trip and last dive...).

Instead we now use the remembered state of the trip to determine whether
it should be expanded or selected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>