rqt_runtime_monitor: Fix selection permanence across state transitions

We need to use the tree to set the current item, and the was_selected logic was broken, too.

This has been broken for a while, and was driving me crazy. So here is a fix.