Fix decoding of chunked body.

@maxlapshin and @benoitc, I believe this is the issue you saw in #481.

`cowboy_http:te_chunked/2` does not reduce it's remaining size when it parses an incomplete chunk.

On the face of it this patch may seem slightly too complicated but given "anything" could be in the buffer passed to it we need to match all these cases.

Edit: I've updated the commit message. There was also an issue if the trailing \r\n was not in the buffer.