Refactor build rules for hidden API lists

The build rules were getting messy and too difficult to extend.
Extract assertions into own functions, create shared variables.

Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Change-Id: Ie34adb8b5349b30daa2e9e4976d285f6d9711f0e
2 files changed