Add support for temporarily patching in a non-method using "with".