brillo_uefi_x86_64: Add A/B selection logic.

Boot loaders used for Brillo must support A/B selection that allows for
selecting from multiple boot slots (typically 2, perhaps up to 4). This
provides capabilities of background system updates and the presence of
redundant partitions as backups.  A/B flow lets the bootloader fall
back on valid slots when the threshold attempts to boot newly
downloaded slots is reached -- thus reverting to a known safe state.

This CL provides both the implementation of the brillo x86-64 uefi boot
loader which is aware of multiple slots and a posix test harness to
unit test the a/b flow logic of this boot loader.

Additional A/B flow logic description may be found in the Brillo Boot
Loader Requirements.

TEST=Unit tests for A/B logic plus manual testing in qemu.

Change-Id: I69358a9a845de89d04f84dd58c2bd803ff522e30
15 files changed