tests: Make patching in pygtkcompat reversible
Record all the attribute and sys.modules changes and add an API for reverting them after tests are completed.
This allows us to run the pygtkcompat tests in the same test process as other tests.
Record all the attribute and sys.modules changes and add an API for reverting them after tests are completed.
This allows us to run the pygtkcompat tests in the same test process as other tests.