Create onTeardown and use it.

This allows us to only add teardown steps when they are valid,
avoiding confusing teardown errors like the one at the top of
b/372688652.

For more detail: go/onteardown

Bug: 372688652
Test: ran tests in CL locally
Flag: TEST_ONLY

Change-Id: I22fee69cb0fb3b8cabe7c7fe9f3bcf0aeb0d7d48
5 files changed