This just makes an additional simplification after D11552 replaced util::Ref with std::any.
Note that we sometimes wrap the context in a HTTPRPCRequestProcessorinstance, so some changes don't apply in bitcoind.cpp and init.cpp.
This is a backport of core#21574
Depends on D11552