Fix inserting classes to initiating loader's class table.

Fix two cases that were missed in
    https://android-review.googlesource.com/312285

First, copy all class references to app image class table,
including boot image classes where the class loader used for
AOT is only the initiating loader, not the defining loader.

Second, add array classes to the initiating loader's class
table.

Without these fixes, ClassLinker::LookupResolvedType() was
actually relying on the type being in the dex cache because
in some cases the slow path would not be able to find it.

Add a test for ClassLinker::LookupResolvedType() with an
array type and fix that function to avoid null pointer
dereference.

Test: m test-art-host
Bug: 30627598
Change-Id: I7cb14788700e6a22d16c364f8a35e2b6b3d954e4
diff --git a/runtime/class_table.h b/runtime/class_table.h
index f27d809..c8ec28e 100644
--- a/runtime/class_table.h
+++ b/runtime/class_table.h
@@ -240,6 +240,7 @@
   }
 
  private:
+  void CopyWithoutLocks(const ClassTable& source_table) NO_THREAD_SAFETY_ANALYSIS;
   void InsertWithoutLocks(ObjPtr<mirror::Class> klass) NO_THREAD_SAFETY_ANALYSIS;
 
   size_t CountDefiningLoaderClasses(ObjPtr<mirror::ClassLoader> defining_loader,