Improve curl_httpclient so it supports custom methods with payload.
Before this, no custom method (e.g. PATCH) added body to the CURL request.
Merge branch 'master' of github.com:tatiana/tornado
Merge branch 'master' of github.com:tornadoweb/tornado
Refactor: simplify patch test according to @bdarnell recommendations at #1090
Move patch test to httpclient_test, according to @bdarnell recommendation
using httpclient_test.py instead of curl_httpclient_test.py so simple_httpclient_test.py is benefit from it as well
#1090
Fix tests so they are compatible with python 3.x
Code cleanup with guided by @bdarnell at #1090
Merge branch 'master' of github.com:tornadoweb/tornado
Merge pull request #1090 from tatiana/master

Improve curl_httpclient so it supports custom methods with payload.
Improve error handling during ssl handshake.

Previously if do_handshake raised an error not in CONNRESET,
the socket would not be closed properly and the server would start
using 100% of the cpu.

Also handle EBADF errors from do_handshake without logging since
they can be generated by some modes of nmap scans.