Parser: modify chunk end detection when waiting for header