The problem is that LWP::Protocol::http::request assumes that the collector sub will be called until it returns 0, at which point the $completed variable is set and the connection will be cached.
If the collector sub never returns 0 then the connection is not cached.
The "patch" calls the collector sub until it has accumulated the whole body but no more, so the collector sub never returns 0, so $completed is never set, so the connection is lost.