Clean up orphaned items (fixes #291)

These changes extend the cleanup function of the items daos to also remove any items whose source field doesn't have a corresponding entry in the sources table.

From my testing, #291 occurs when deleting a source while update.php is running.
So, one option would have been to check if the source still exists every time an item is inserted when updating, or to clean up afterwards and delete all items that don't have a corresponding source.
I think that cleaning up afterwards is the better way to handle this, and this pull request implements it.