I suppose that you've getting overlap because both forks of your code are trying to access the screen at the same time. I might create a semaphore or a flag that controls whether the screen is being written to or not. Same basic idea, but it might be useful later to treat it as a "screen-control" flag instead of a "about-to-send" flag.

Incidentally, there's no real need for the server, apon receiving a message from a client, to immediately send that message back to the client. I'd broadcast the message to all of the connected clients except the client that sent the message in the first place.

The client knows what it sent. It doesn't need the server to tell it.