prefs: ensure properly detection of containers in tree rows

(integrated from master branch change c408c2f by Todd Whiteman <toddw@activestate.com>)