util: Log early messages
Summary:
Early log messages are dropped on the floor and they'd never make it to the console or debug log. This can be tested by running the test included in this pull request without re-compiling the bitcoind. Fix that by buffering early messages and flushing them as soon as all logging options have been initialized and logging has been started.
Backport of core PR16112.
Test Plan:
ninja check check-functional
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5553