Retry a few times to ensure the garbage collector collects what we expect. Also merge and remove testJavaRefGC which was identical except for one line. Updates golang/go#30785 Change-Id: Id6c541b41fe483633c40eeea712c1f43b647e4f4 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/167657 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>