Work around a dalvik JDWP/GC deadlock.

Also add a few missing TEMP_FAILURE_RETRYs that can cause dalvik to
incorrectly decide that the debugger connection has been broken.

Bug: 8191824
Change-Id: I791b514c6bec1ca634a65d9f87c5fa06da01b5ed