Protect against invalid parents in the IdTreeDB
DocumentUrlDB::put is susceptible to invalid parent ids caused by e.g.
renaming while a file/path is added. filePathToId will return 0 for a
(now) invalid dir, although 0 is reserved for the root folder.
As Writetransaction::removeRecursively calls itself for any child document,
having a 0 as child causes infinite recursion.
Test Plan: ctest
Reviewed By: Baloo, ngraham
Differential Revision: https://phabricator.kde.org/D20281