mkbootimg: Factor out GKI certification logic am: 743804f7ef am: 4112125878 am: 073ed07638

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

Change-Id: Ib4382d1352354453b59aaf78711e462337965e10