Reduce flicker memory consumption (Pt 4)

Improve flicker memory consumption with the following:
- Use a static factory for better compatibility with JUnit4 ParameterizedRunner
- Ensure `cleanUp` is always called, even when an exception occurs

Bug: 178572522
Test: atest FlickerTests WMShellFlickerTests
Change-Id: Id9e539c0e8bce350f94811cab58a726e47aac525
25 files changed