Add some more safety checks and use streaming for the local collection listing.
Unittests for hierarchical RIDs still fail though (but at least don't
crash anymore), which is mostly due to collections without proper
ancestor chains provided by the tests.
svn path=/trunk/KDE/kdepimlibs/; revision=1004618