ART: Fix missing wait in GetAllStackTraces

It's the responsibility of the caller to wait until all threads
have run the checkpoint. Add a barrier and refactor code into a
helper that initiates the checkpoint and waits for completion.

Follow-up to commit f1221a1f39987b94a54dc57b824fcf360c890ed0.

Bug: 62353392
Test: m test-art-host
Change-Id: I2d31b8ef9964a2e525dc4292c00d3caf3498718c
1 file changed