Cleanup of #8928.
Also "hides" ThreadFlushWalletDB from init.cpp.
This moves ReacceptWalletTransactions further down so that it will be executed after the connection manager has been started. I think this should not be a problem.
@TheBlueMatt: would be nice if you could do a retest regarding the segfaults in init you have discovered.