Fix HTTP client in conjunction with non-SSL connections (null pointer dereference). Fixes #523.