[MainWindow] Don't user TreeIters as long lived references

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>