Move InactivityCheck logic to private method.
Summary:
This is a partical backport of Core PR14335 : https://github.com/bitcoin/bitcoin/pull/14335/commits/2af9cff11ad3ef27893b4b2009ddbfcb208554a9
Depends on D4087
Test Plan:
make check ./test/functional/test_runner.py
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D4088