vboot2: Fix saving the slot we tried back to nv storage

Previously, we only kept that slot info in RAM.  We read it from NV
storage, but never wrote it back.

Added a test to confirm proper behavior (and made sure it failed
before patching 2misc.c with the fix).

TEST=VBOOT2=1 make runtests

Change-Id: Ie12124d9cbe417914fbde14ea5086380d637240f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221214
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2 files changed