Unix socket enhanced v1.3

Here's a new PR. Only difference with previous PR, is the locking fix.