Only apply monkeypatches once

Use a decorator to ensure each monkeypatch is only installed once, even
in the face of multiple integration tests that call
'monkeypatches.patch()'.  This avoids very deep recursion when running
tests repeatedly in the same interpreter.

Also, clean up the test-only monkeypatches to follow the same convention
as the production monkeypatches.
Merge branch 'patch-only-once' of git://github.com/djmitche/buildbot

+autopep8 changes