SI-8976 Improve test for collectability

Use the memory pressure thread to simplify testing for collectability.

The test thread blocks on the reference queue with a longish timeout.

If the allocator thread sees the heap grow, or sees the reference get
cleared, it will stop automatically.

On heap growth, the test thread is interrupted; it will block on the
queue a second time, without the allocator (which is extraneous
because it has already witnessed memory pressure). This allows the
test to run in parallel with other arbitrary activity.

The timeout on the queue.remove determines the timeout period for
the test.

Both API in the test utility are exercised: one takes the reference
object explicitly, the other takes just a value generator.