http-fetch: fix possible segfault