Avoid running Runtime.gc() until we need to run finalization.

This prevents excessive explicit GC which are called from apps to get
good GC behavior on Dalvik. Calling System.gc() does not help on ART
since GC for alloc is much rarer.

If running finalizers is requested following a System.gc we remember
that a GC was requested and perform it ahead of finalization.

Bug: 12004934

Change-Id: Id1343ce8b5378c5f53c1e5649c06ddd045f56a3b
Fix CTS test failure under ART

The Thread.interrupted() State from
SelectorTest.testInterrupted() was leaking into
SelectorTest.testManyWakeupCallsTriggerOnlyOneWakeup() causing
that test to fail when the CTS was run with the ART. Under
Dalvik the "interrupted" state was being reset, but it was
causing the test runner to run each subsequent test in its
own Dalvik instance (which probably slowed down the tests but
wasn't causing failures).

It is unclear why a Thread being in "interrupted" after a test
does not cause problems for ART in the same way it causes
problems for Dalvik.

Bug: 12905142
Change-Id: I677c1d46602d10e174ba3b6b8614529b5c902104