Speed up PluginInstanceTest by skipping unnessecary gc runs

Bail from the GC loop early if the allocated instances falls to match
or be below the expected number of allocations. This should speed up
most test runs when the test is passing.

Bug: 299965591
Test: atest PluginInstanceTest
Change-Id: Ic01305ad93f133001eee83ec7134523e650dc7e8
1 file changed