This adds a timeout to long polling requests for issue #765 .  The timeout is sent to the client as a header during the initial handshake.  I will make the timeout configurable in another PR.