Clean up the AppRestrictionController instance after each test.

Also, clear the invocation counts,  wait for the idleness of handler,
to address the flaky test issues.

Bug: 203105544
Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest
Change-Id: If1ccb8bccd576421c1545cd20b40352a07d2ae45
3 files changed