Correctly remove path of deleted db file from the queue.

Fixes #1833.