Fix concurrency issue in constant caching.

Because updating the constant cache for a piece of compiled code
is not atomic (multiple cache structures must be updated) it was
possible for the tests in isCached and isCachedFrom to see a non-
null value in the "constants" array before the invalidation
structures in the other arrays (constantGenerations,
constantInvalidators, constantTargetHashes) were set. This allowed
the first "value != null" check to pass, proceeding to access the
object in constantInvalidators even if it was still null.

By moving the update of the "constants" array after the update of
the invalidation structure arrays, we mostly guarantee they'll be
up-to-date before the value is non-null.

Note that this is not necessarily true given reordering and
volatility on the JVM. The RuntimeCache needs to be reexamined to
ensure happens-before on these particular non-atomic structure
updates.
Merge remote-tracking branch 'origin/master'