C++/TCPSocket: Add some error-handling