dnsdist: Fix a hang when removing a server with more than one socket
There was a lock starvation issue when removing a server with more
than one socket in use (`sockets` greater than 1 on the corresponding
`newServer` directive), because the mutex protecting the sockets array
would never be released long enough by the responder thread to allow
the thread stopping the server to acquire it.
This commit fixes that by marking the server as stopped right away,
before acquiring the lock, and also making sure that the responder
thread is woken up regularly (every second, even without any query
to process) and that it checks whether the server has been stopped
just after that.
The issue was introduced in
be55a20ce9bb7140071279d70bcb460f1f2b7b7d,
and backported to 1.5.1 in
f0d48318cce0dd80ae73c529362bdb2921d8c5c9.