Improve exit logic in test fixtures.