Fix potential infinite loop in MultipartBody when using stream wrappers (bug #19934)