This diff introduces a libbitcoinkernel library linking in the minimal list of files necessary to use our consensus engine as-is. bitcoin-chainstate introduced in D15015 now will link against libbitcoinkernel.
Note that for now there is no good reason to introduce the new BUILD_BITCOIN_KERNEL_LIB option, we can gate both the bitcoin-chainstate executable and the bitcoinkernel lib with the same BUILD_BITCOIN_CHAINSTATE option until it makes sense to split them.
This is a backport of core#24322
Depends on D15015