Correct handling ArtMethod array during class linking

In case of userfaultfd, we were setting declaring_class_ of all
ArtMethods to nullptr. This could cause problem if a GC is taking place
simultaneously and it is visiting the ArtMethod array at the same time.

Instead, we should convert the array to a 'no gc-root array' so that
compaction code skips it. The marking-phase will simply skips it as it
will no longer be pointed by the class.

Bug: 301880194
Test: test infra
(cherry picked from https://android-review.googlesource.com/q/commit:5c5890106a8555a40b33c0a90fc7341a8bce0b8e)
Merged-In: I72007dd94ad71aa9ccc6005eb6d99b5a8c1ad7ee
Change-Id: I72007dd94ad71aa9ccc6005eb6d99b5a8c1ad7ee
3 files changed