FIXED: Added enter/exit scan to update_duplicates() to avoid that
duplicate detection crashes on freed triples.
FIXED: Delay unregistering atoms and literals from triples until the
triple is really deleted.  Without, we may still process the triple
after it has been deleted.