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.
1 job for restore-global-locks in 51 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #46821
build-and-test

00:00:51