Move state restoration from setup/teardown into affected test cases.
Merge pull request #15082 from zuhao/refactor_actionmailer_delivery_methods_test

Clean up deliveries after each test.