Fix memory leak in TreeItem
Summary: The deletion should be operated on copy rather than the original childItems, which gets cleared already.
Test Plan: Tested with lldb and gdb unittests, with no regression.
Reviewers: KDevelop, kfunk
Reviewed By: KDevelop, kfunk
Subscribers: kdevelop-devel
Differential Revision: https://phabricator.kde.org/D3941