RenderScript cts: Fix issues related to concurrency.

Use a volatile qualifier for msgHandled in RSBase, since the flag
is accessed by multiple threads at the same time.

Ensure that checkForErrors() is called after waitForMessage() to
avoid a race condition.

Change-Id: I6d3811f16003d891d79ad5efe9d6f34a50132576
(cherry picked from commit a73d4999fcb8433d6c8cdff0f2e22a5e2b538294)
4 files changed