Switch wireup.canonical to use env

This was a little complicated because in test_hooks we do a dance with
canonical, and I had to update that to work with env instead of
os.environ directly.
Merge pull request #2228 from gittip/canonical-env

change wireup.canonical to use env