iterating over a BTree while modifying it. Fixes #11402. svn path=/plone.app.discussion/trunk/; revision=48845