c: Avoid race condition between disconnect probe thread and disconnect function

There is a chance that the disconnect function locks the socket mutex and
tires to join the disconnect probe thread while the disconnect probe thread
is about to lock the socket mutex. This results in a dead lock.

Avoid this problem by not locking the socket mutex in the disconnect probe
thread. This locking was not necessary as the disconnect probe thread only
exists while the socket is valid.

Also add a send mutex to the socket for serializing send calls, which was
realized by the socket mutex before.