Clear allocator in image writer

Doesn't fix any active bugs, just precautionary.

Change-Id: I32a89e00b1d5964ad77fb53eded55263fea5df00
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 955c575..d9f8fcb 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -1362,6 +1362,10 @@
         // If src is a ClassLoader, set the class table to null so that it gets recreated by the
         // ClassLoader.
         down_cast<mirror::ClassLoader*>(copy)->SetClassTable(nullptr);
+        // Also set allocator to null to be safe. The allocator is created when we create the class
+        // table. We also never expect to unload things in the image since they are held live as
+        // roots.
+        down_cast<mirror::ClassLoader*>(copy)->SetAllocator(nullptr);
       }
     }
     FixupVisitor visitor(this, copy);