Fix failing check during JDWP invoke.

Fixes a race where the JDWP thread expects the invoke thread can be suspended
(suspend_count != 0) before invoke thread actually updates its suspend count.

It happens after the invoke thread signals the JDWP thread to notify invoke is
completed but before incrementing its suspend count. In the meantime, the JDWP
thread wakes up and checks whether invoke thread has updated its supend count.
But there is no way to prevent the JDWP thread to do so before the invoke
thread updates its suspend count.

We now move the invoke completion code after the suspend count update. Then the
JDWP thread wakes up at the right time.

Bug: 11247837
Bug: 12578041
Change-Id: Ib6079c6e330671b34217838e26b1e758706d3da6
2 files changed