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.
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.