define and use errno_from_exception abstraction

If an OSError or IOError are instantiated without an errno value, e.g.
e = OSError(). The existing code would give an IndexError: tuple index
out of range. However there have been cases that the errno attribute
wasn't populated so instead of switching to it this introduces a helper
function to ensure we get the errno value through whatever means
possible.
update Template Loader with 'with' statment
Merge pull request #999 from mengzhuo/master

update Template Loader with 'with' statement
Exclude another timing-sensitive test from the travis build.
Merge pull request #996 from cardoe/exception-fix

use errno attr instead of index into args for errno
twisted can be installed without twisted.names fixes #1007
remove useless code of BaseIOStream
Merge pull request #1008 from yaccz/fix/1007

twisted can be installed without twisted.names fixes #1007
Merge pull request #1012 from dlutxx/br310

remove a redundant assignment in read_until_close.
Fix command-line tornado.httpclient on python 3.
Improve simple_httpclient ssl configuration to pass howsmyssl.com.

Remove insecure cipher suites and disable TLS compression.  The option
to disable compression was only added in Python 3.3 so we do not
pass the test on older versions, but we come as close as possible with
the APIs available.

Closes #1014.
Refactor unittest/unittest2 imports to fix issues with unittest2 on py3.

Never use unittest2 on python 3 (it appears to not interoperate with
the standard unittest module).  On python 2, use the same logic in
tornado.testing and tornado.test.util to select an implementation.

Fixes #1005.
Update links for comments about json list output.

The vulnerability in the older link affects only ancient browsers,
but there are other issues that are more recent.

Fixes #1009.
add IOLoop.clear_instance

like clear_current, but for the global IOLoop instance
Merge pull request #1019 from minrk/clear_instance

add IOLoop.clear_instance
Fix a mistake in template document.
Merge pull request #1020 from dhcmrlchtdj/fix-template-doc

Fix a mistake in template document.
tab to space

tab to space and indent fix
Merge pull request #1022 from shinriyo/master

tab to space
put assertion outside of the exception handler