fix Socket not cleanly closed after ECONNRESET