[avalanche] Remove getPubkey API
Summary: Instead, provide a more generic forNode function that provides a temporary access to the node object. This ensure locking remains correct while not requiring accessor for anythign and everything.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D6828