Fix pending exception failure for encoded statics

ReadValueToField may allocate a string and cause OOME, we were
not checking this each loop iteration. Throwing an exception
with a pending exception causes an abort.

Bug: 30690988

Test: test-art-host

(cherry picked from commit da595bec0f9af0b087822e4febc282fe8ec28192)

Change-Id: I4701a4dcc63553aeb5c7970f99fd7f136443b266
5 files changed