Crash on Request.Do when Client.http.Do() returns an error

When `res, err := r.client.http.Do(req)` returns an error, `res` is nil. Therefore, `res.StatusCode` on the next line causes a panic.