DO NOT MERGE Add locking to prevent races between setting class methods and marking

There was a race condition between VisitNativeRoots and threads which were
updating the lengths and pointers of the direct or virtual methods of classes.

For example:
The thread doing VisitNativeRoots could see a null pointer with a non 0 length if
another thread had changed the length but not the pointer.

The fix is already in master, do not merge.

Bug: 24270063
Change-Id: Id7280b9507b95703820aedb6c5fee49966dabe27
1 file changed