[Passwords] Fix for LoginDatabase that got downgraded from 25 to 24

The fix to protect against login database downgrade has been included
in version Chrome 78. However, users running Chrome 77 still suffer
from this issue and could potentially download the login database
from version 25 to 24 without changing the schema.
Chrome 25 however introduce a new column in the login database.
Therefore, trying to migrate again from version 25 to 24 would actually
fail and results in password manager to stop working.

Before this patch:
If users enter this broken stay, they will stay there indefinitely.

After this patch:
The code would auto-correct the version for such broken state.

The issue has been reported in the public support forums.
Details are in the linked bug.

This CL in addition adds the proper testing for this user flow.

(cherry picked from commit e70ed1c319358339264d0fc55db3a39fa1630ad1)

Bug: 1020320
Change-Id: Ib97e26a21ba4840f599e599edc75835292584873
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899462
Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#712589}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1908065
Reviewed-by: Mohamed Amir Yosef <mamir@chromium.org>
Cr-Commit-Position: refs/branch-heads/3904@{#867}
Cr-Branched-From: 675968a8c657a3bd9c1c2c20c5d2935577bbc5e6-refs/heads/master@{#693954}
4 files changed