Fix various warnings
TreeBrowser: Don't assign a literal string to a non-constant pointer
TreeBrowser: Don't leak name and URI upon right click
TreeBrowser: Fix the row to which the popup menu pops for

When right-clocking, the clicked row got selected but the name and URI
were still fetched from the previously selected row.  Fix this so if
the user right clicks on an unselected row the popup works for the
corrected item.
TreeBrowser: Fix various runtime warnings and memory leaks