[WebConnection]: Fix incorrect end detection for chunked encoding.

This should fix #12355/#12395.