fixing #3799: only unindex if DB operations succeeded previously in the first place...