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
Re: CRLF in HTTP: at least on Linux, ```telnet``` defaults to the mode where ```\n``` from  the terminal / standard input translates to ```\r\n``` being sent.