More X86 fixes.

Fix bugs in a few long entrypoints and with object validation being
enabled.

Change-Id: I18884fbbe6829b584b9fc92e338549577f925f14
diff --git a/src/runtime.cc b/src/runtime.cc
index c4a9bd7..c013726 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -634,7 +634,6 @@
                    options->heap_growth_limit_,
                    options->heap_maximum_size_,
                    options->image_);
-  heap_->EnableObjectValidation();
 
   BlockSignals();
 
@@ -649,6 +648,9 @@
   // Set us to runnable so tools using a runtime can allocate and GC by default
   Thread::Current()->SetState(Thread::kRunnable);
 
+  // Now we're attached, we can take the heap lock and validate the heap.
+  GetHeap()->EnableObjectValidation();
+
   CHECK_GE(GetHeap()->GetSpaces().size(), 1U);
   if (GetHeap()->GetSpaces()[0]->IsImageSpace()) {
     class_linker_ = ClassLinker::CreateFromImage(intern_table_);