handle ECONNRESET upon early stdin end