Close response bodies on error

Also check JSON decoding errors.
Merge pull request #3 from edsrzf/bugfix-close-error-responses

Close response bodies on error