move defer calls to after error check to avoid panic

I was getting a panic if my internet connection dropped or made a bad request to Salesforce. After doing some research ( http://stackoverflow.com/questions/16280176/go-panic-runtime-error-invalid-memory-address-or-nil-pointer-dereference ) I detected it was the defer call being made to Close() the HTTP Connection even if a connection didn't exist. This PR fixes this issue.