Eliminated an infinite loop in case of connection prematurely terminated by peer.

Continuing from @sompylasar's https://github.com/dkorolev/cpp_graph_test_server/pull/2.