2misc: Abort before using GBB if gbb_offset is not initialized

In vb2_get_gbb, abort if gbb_offset is zero. This ensures that functions
like vb2api_gbb_get_flags won't try to read garbage GBB data if the
context hasn't been properly initialized.

Some additional changes made to fix tests:
1. In vb2_set_boot_mode, don't access GBB unless needed.
2. In vb2api_get_dev_default_boot_target, use vb2api_gbb_get_flags
   instead of vb2_get_gbb to make it easier to mock. This is needed for
   depthcharge tests.
3. Make vb2api_get_debug_info tolerant of GBB not being set. This is
   needed for depthcharge tests.

BUG=b:237093169
BRANCH=none
TEST=make && make runtests

Cq-Depend: chromium:3820402
Change-Id: I921d6cc4a5d91c8114c5e46748b4576a1e7716d0
Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3817941
Reviewed-by: Julius Werner <jwerner@chromium.org>
3 files changed