Fixed infinite loop that takes over the CPU during request handling

* Prevented the infinite loop in HTTP header parser
* Fixed invalid typecasts in GenericConnection
* Fixed typo in the comment
I don't think it's true. POSIX socket does not have the end-of-file notion (http://stackoverflow.com/a/17508267).

One can not definitely conclude that if ```read_count``` is zero, no more data will arrive; more data may come later.

In this particular piece of code, ```Content-Length``` is being analyzed. I (D.K.) am not 100% sure, but have checked with the HTTP RFC that it would be the canonical way to go.

Before we dig further, could you check whether ```Content-Length``` is set in your request?

Thanks,
Dima