graphite/write: make sure we lock the socket before using it
graphite/write: make sure we lock the socket before using it

We may close it or open it in in the next few lines, so lock
to avoid shutdown() messing with us.

Thib17/graphite-remote-adapter,Thib17/graphite-remote-adapter,Thib17/graphite-remote-adapter