fix exception when remote end closes socket (errno 10054)