In this commit, we modify the WitnessCache's
AddPreimage method to accept a variadic number
of preimages. This enables callers to batch
preimage writes in performance critical areas
of the codebase, e.g. the htlcswitch.
Additionally, we lift the computation of the
witnesses' keys outside of the db transaction.
This saves us from having to do hashing inside
and blocking other callers, and limits extraneous
blocking at the call site.
In this commit, we add the preimageBeacon which is an implementation
of both the contractcourt.WitnessBeacon and lnwallet.PreimageCache
interfaces. This will be used when closing channels to check to see if
the know the preimage, and also to communicate to any active contract
resolvers once we discover a preimage either on-chain or off-chain.