certify_bootimg: avoid using subprocess calls to unpack_bootimg

Uses function calls instead. This makes a certify_bootimg
binary can work without a unpack_bootimg binary. This can
reduce pre-built binaries in a kernel tree.

Bug: 180712476
Bug: 226121398
Test: atest --host mkbootimg_test
Test: atest --host certify_bootimg_test
Change-Id: I48c9f6767cb7b2c3e3bead008e630eeef310fca3
4 files changed