tessel/runtime — pull request #467 by jiahuang (2014-09-14 21:41:04+00:00)
Title: do not push after EOF

Some servers like to return two HTTP responses per one request. Ex:

```
>> nc httpstat.us 80
POST /200 HTTP/1.1
Host: httpstat.us:80
Content-Type: application/x-www-form-urlencoded
Content-Length: 4

t=12
HTTP/1.1 200 OK
Cache-Control: private
Content-Length: 6
Content-Type: text/plain; charset=utf-8
Server: Microsoft-IIS/8.0
X-AspNetMvc-Version: 5.1
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Set-Cookie: ARRAffinity=68f2c4702993bb496bba1369216eee8c05d14edfbe81273760dc3e2f77ca437a;Path=/;Domain=httpstat.us:80
Date: Sun, 14 Sep 2014 20:13:19 GMT

200 OKHTTP/1.1 400 Bad Request
Content-Type: text/html; charset=us-ascii
Server: Microsoft-HTTPAPI/2.0
Date: Sun, 14 Sep 2014 20:13:19 GMT
Connection: close
Content-Length: 326

Bad Request

Bad Request - Invalid Verb

HTTP Error 400. The request verb is invalid.

```

This ends the socket writes after the first EOF, otherwise we try to keep pushing data into the stream after it's already been closed.