Update the callstack index when changing the functions (#3693)
Update the callstack index when changing the functions (#3693)

When changing the selected functions (i.e. also the callstacks),
we do not update the selected callstack index.
When the old selected index is now larger than the new number
of unique callstacks, we do not update the callstack at all.

With this change, we are resetting the selected callstack
whenever we select a "new" set of functions (if there is no
change, we do nothing).

Test: Take a capture and play with callstack selections.
Bug: http://b/232059032
google/orbit,google/orbit,google/orbit,google/orbit