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.

{
public:
    TorController(struct event_base* base, const std::string& target);
    ~TorController();
    
    fs::path GetPrivateKeyFile();
    
    void Reconnect();
private:
    struct event_base* base;
    std::string target;
    TorControlConnection conn;
    std::string private_key;
    std::string service_id;
    bool reconnect;
    struct event *reconnect_ev;
    float reconnect_timeout;
    CService service;
    
    std::vector<uint8_t> cookie;
    
    std::vector<uint8_t> clientNonce;
    
    void add_onion_cb(TorControlConnection& conn, const TorControlReply& reply);
    
    void auth_cb(TorControlConnection& conn, const TorControlReply& reply);
    
    void authchallenge_cb(TorControlConnection& conn, const TorControlReply& reply);