fixed a silly bug in the ugly http-client library used for testing

also don't rely on strlen() where not necessary (and even harmful)

the library needs a deeper review/rewrite ... but since it's used only
for the test-units it's something very low priority