C++ Threads, client/server using TCP sockets