Delete documents created by libkis directly
Otherwise you will have to wait until the even loop kicks back in before the images are really deleted, and that only happens after the script is done running.
CCBUG:412740