fix #11401: remove deleted tree notes from selected set (rebase)

The four steps described at http://trac.openmicroscopy.org.uk/ome/ticket/11401 should no longer crash Insight. Play a bit with tree selection and deletion to make sure it still works properly.

rebases #1427