simplify test runs for streaming tests with chunks

move out the common pieces into a separate function and use it for both the simple and the Content-Length header tests.

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>