rpc: If the socket is closed by peer, endpoint stop the serve.

If client does socket.close() the serve will be non-wait looping.
So must stop the serve of endpoint that received 0 byte packet.
rpc: prefix close_by_peer with _ as it's private
rpc: test case