Add testing object tracker to simplify test method

- Reduce lots of indents when using session-like object by
  having a centralized place to close the managed closeable.
- Avoid misusing of some objects that should do something but
  are untouched.
- Move assertion out of tearDown to avoid incomplete cleanup
  of subclasses.

Bug: 112837428
Test: atest CtsWindowManagerDeviceTestCases

Change-Id: I27ef2267197b6cda653bda4cf29a2a8483e8e6f3
40 files changed