Unify lists of errnos used in IOStream.

We generally want to treat aborted connections the same regardless of the
specific errno, but some calls caught ECONNRESET and ECONNABORTED
while others only caught ECONNRESET.  Reported in #828.
Clear the write buffer when an IOStream is closed.

Closes #828.