HTTPServer keepalive timeout

I didn't want to make a new branch and pull request for each of these, so I'll just put them all together (unless you want separate branches):

468d37c7 adds an optional timeout to keep-alive connections in the HTTP server, via the keyword argument connection_timeout in the HTTPServer constructor. Without this, when the client's connection dropped, the connections would sometimes never get closed, which led to our server accumulating open sockets and eventually running out of file descriptors.

96f057c3 fixes the IOStream close callback sometimes never getting called if it was delayed due to pending callbacks.

690081f4 fixes a bug in the draft-10 WebSocket implementation: The size of messages of length 126 was not encoded properly.