Using Ubuntu 18.04.2 LTS, with up-to-date, self-compiled master.
When I run
`./bitcoind -regtest -whitebind=bla`
I expect a clean shutdown with `Error: Cannot resolve -whitebind address: 'bla'`.
However sometimes my node doesn't stop and freezes (shutdown never finishes). 
This happens ~30% of the time for me, both on testnet and regtest. 

I believe that this is because `torControlThread.join();` never returns if it the thread is stopped right after its creation - it is started right before the whitebind part in `AppInitMain()`. If I insert a sleep before whitebind parameters are processed in Step 12 of `AppInitMain()` (or if I just disable the TorControl thread) the error does not occur.

Could someone try to reproduce? I encountered this testing #16248, but it is not restricted to this branch.

{
    /* Try to reconnect and reestablish if we get booted - for example, Tor
     * may be restarting.
     */
    if (!conn.Connect(target, std::bind(&TorController::connected_cb, this, std::placeholders::_1),
         std::bind(&TorController::disconnected_cb, this, std::placeholders::_1) )) {
        LogPrintf("tor: Re-initiating connection to Tor control port %s failed\n", target);
    }
}
fs::path TorController::GetPrivateKeyFile()
{
    return GetDataDir() / "onion_private_key";
}
void TorController::reconnect_cb(evutil_socket_t fd, short what, void *arg)
{
    TorController *self = static_cast<TorController*>(arg);
    self->Reconnect();
}
static struct event_base *gBase;
static std::thread torControlThread;
static void TorControlThread()
{
    TorController ctrl(gBase, gArgs.GetArg("-torcontrol", DEFAULT_TOR_CONTROL));
    event_base_dispatch(gBase);
}
void StartTorControl()