Fix deadlock during connect and a bunch of other issues

The plan was to fix the deadlock during startup after 7bacc2200a839b7ede516705e62573a93583d379, but I found some other issues along the way.

* the first commit fixes the deadlock on startup. If the global lock is removed from client.cpp.Create() the whole thing segfaults when Disconnected() is called. The method shouldn't really be needed anyway since Connected() sets the same values and it's called a bit later on.

* I introduced a simple SSettings struct which is passed to CTvheadend and CHTSPConnection. This way these classes don't have to bother with the global lock to read setting values.

* 630ffc1 could theoretically fix something, I don't see why we wouldn't wait for a response here. The rest of the calls to SendWait0 (the version that doesn't wait) are called when the registration process has not yet been completed (like SendHello and SendAuth).

* cf39898 should hopefully fix the issue people have been having with "Connection lost" during startup. This happens from time to time (about once every seven restarts in my observations) and it was we basically waited only 5 milliseconds in WaitForConnection().

* the last commit replaces some magic values with the timeout values

@BtbN mind testing if this fixes anything for you?
@FutureCow you too