Fixes a socket error.

It fixes it in the instance where it was showing up for me, running tests still yields errors elsewhere, but I assume the same fix can be applied.

Unsure why request.Session.__exit__() doesn't handle this.

I'm just checking to avoid error messages, you could check `self.http.__getstate__` as well.