tcp-bsd: Restore global locks

Avoids race between socket_send_more() and socket_close() leading either
to crash on use of freed NiceSocket, or abort upon attempting to
g_mutex_clear() a locked mutex.

Akin to what d1611c0c did to udp-turn.
Status Job ID Name Coverage
  Build
passed #47009
build-and-test

00:00:47