client: Handle closed socket error when sending/receiving messages from server

This resoves an endless loop when the server is killed.
Use std::thread in client code, as we are already using C++11
Move method to receive user's message to Client class

Also, remove the public method get_sock_server from Client class.