simple chat-client using tcp and mutex synchronization