Backport SVN commit 929523 by vkrause:
When trying to delete a non-existing item we could end up with a
still open transaction, causing all following changes in the
same session to be non-persistent.
svn path=/branches/KDE/4.2/kdepimlibs/; revision=929529