mkbootimg: Factor out GKI certification logic am: 743804f7ef

Original change: https://android-review.googlesource.com/c/platform/system/tools/mkbootimg/+/1933193

Change-Id: I4cdee59f69441329af1656651b8fb15eef9fee25