```
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.