Fix segfault when node no longer connected
Summary:
nodestate can be NULL when node is no longer connected,
leading to a segmentation fault (refer T64).
Added assertions to other places where node state was
obtained and later used without checking if non-null.
Test Plan: make check
Reviewers: #bitcoin_abc, deadalnix, sickpig, awemany, dagurval, CCulianu
Reviewed By: #bitcoin_abc, deadalnix, dagurval
Differential Revision: https://reviews.bitcoinabc.org/D324