Fix crash bug: .Close on nil pointer

Closing an HTTP response body is not necessary when an error is
received.