[avalanche] introduce EnsureAvalanche helper for RPC calls
Summary:
This diff is split out of D16224.
This factors the if (!g_avalanche) { throw... code out of the RPC code.
The NodeContext argument to the function is currently unused, but it will become used in D16224, so adding it now will save us from having to modify all the callsites again later.
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D16249