A minor refactor in wsgi.py

A minor refactor to move the code up in the file as suggested by termie
and henry regarding the review comments in
https://review.openstack.org/#/c/26487/

Fix bug 1166697

Change-Id: I890415c755dd383749f2d4382f53d0b3a6badc6c
Revoke tokens on user delete (bug 1166670)

Change-Id: Ieeb2246579ddc0608092eed5239258d2b4dbf42b
Merge "A minor refactor in wsgi.py"
Disable eventlet monkey-patching of DNS

This change avoids eventlet's monkey-patching of DNS
resolution. eventlet's doesn't support IPv6, for example.

The way to avoid eventlet's DNS is to set an environment
variable. The trick is the environment variable needs to be set
before eventlet is imported.

A similar change was made in nova, so this is just copying
that code and technique to keystone.

This allows re-enabling the IPv6 tests, too.

Change-Id: I30524a1cebd43580d692fd88ef32be45e62758c5