Reland "[IndexedDB] Open sequence cleaned up with better failure handling."

This is a reland of 3bceb8a7a60fbf28867603e80655ce6782831129

The fix here was to not call EncodeInt with a negative number - it DCHECKs
on debug builds.

Original change's description:
> [IndexedDB] Open sequence cleaned up with better failure handling.
>
> The previous open sequence was really hard to understand and only
> sometimes recovered the database. This change cleans this up. See the
> document here for more info:
> https://docs.google.com/document/d/1jX6OOQJ0aLrWAeqYLtARXPFawUlJPbHNIKAK-0vmFHU/edit#heading=h.5qhp88d21pi0
>
> Bug: 862456
> Change-Id: Ib8fa4e48c0154451e8ab787bc0086a57759f05d0
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1665433
> Commit-Queue: Daniel Murphy <dmurph@chromium.org>
> Reviewed-by: Victor Costan <pwnall@chromium.org>
> Reviewed-by: Chase Phillips <cmp@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#671765}

TBR: cmp@chromium.org, pwnall@chromium.org
Bug: 862456
Change-Id: I91c73e4dd1f1ac50704d66a61e1a4146e79f5e62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1676241
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: Chase Phillips <cmp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672281}
14 files changed