[DocumentUrlDB] Catch invalid URLs early
Summary:
DocumentUrlDB::replace calls DocumentUrlDB::put, which silently
discards invalid URLs. In case of an invalid URL, the old URL/name
is removed from the DB, but the new one is never inserted.
Move the core of the function to a private helper (implementing both
delete and rename/move), and make replace a trivial wrapper.
Test Plan: ctest
Reviewers: Baloo, ngraham, astippich, poboiko
Reviewed By: Baloo, ngraham
Subscribers: kde-frameworks-devel
Tags: Frameworks, Baloo
Differential Revision: https://phabricator.kde.org/D21693