sessions.py: pep8 + put deferred as argument

This commit transfers the deferred used in request using an argument
of the function, instead of relying on the dynamic state of the scope
of the functions.
Good point, I think this would deserve a proof. Either doc or unit test I
think we would experience much more problems if your theory is true...

In txrequests/sessions.py:

> @@ -73,5 +74,5 @@ def func():
>                  reactor.callFromThread(d.errback, e)
>
>          d = defer.Deferred()
> -        self.pool.callInThread(func)
> +        self.pool.callInThread(func, d)

because unlike d, args and kwargs are defined and thus included in the
scope of f since its definition, not its execution. Without passing d
explicitly, I'm not sure that the d used in f will, always, be the deferred
defined l.75.

—
Reply to this email directly or view it on GitHub
<https://github.com/tardyp/txrequests/pull/2/files#r18578177>.