tests/unix_sockets: Make the socket blocking and add a read lock