(#2393) - correct update_seq with successive new_edits

This is sort of a follow-up to #2342 &ndash; I found an edge case where the `changes()` will still return the wrong answer, if the database has had successive `new_edits`. This fixes that.

Oh yeah, and this PR is rebased on top of #2391 and #2392, because I didn't want to pre-emptively bitrot myself. So those two need to get merged first.