Fix tcpclient test when ipv6 is available but 'localhost' is only ipv4.
Raise StreamClosedError instead of IOError for ECONNRESET.

This allows application code to only catch one kind of exception
(an ECONNRESET exception is raised from
tornado.test.httpserver_test.KeepAliveTest.test_pipeline_cancel
on linux but not on mac)
Use Resolver instead of socket.getaddrinfo to decide whether localhost is ipv6.

The results can differ with different resolvers.  Add a CaresResolver
configuration to tox (it was already in travis).
Remove test_websocket_network_timeout.

It wasn't testing what it appeared to be (it was hitting exactly the
same code paths as test_websocket_network_fail on posix, but was failing
on windows).

Closes #1054.
Make gen.Task a function returning a Future instead of a YieldPoint subclass.

This improves performance of applications that mix Tasks and Futures
by only entering a stack context for the duration of the Tasks. It
also fixes an obscure regression (#1058).  This might get reverted before
the final release if any backwards-compatibility issues turn up, but
since the status quo also had a regression it's worth a try.

Closes #1058.