Fix SQLite backend so the deletes are not so slow. This is the urgent part of the fix; we'll have another half of the branch later, to clean up some details.