Fix accidental IMT and root marking regression

Was always using the conflict trampoline. Also included fix for
regression in GC time caused by extra roots. Most of the regression
was IMT.

Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to
detached thread.

EvaluateAndApplyChanges:
From ~2500 -> ~1980
GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots

Bug: 19264997
Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index fbde494..59d0259 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1630,7 +1630,12 @@
 }
 
 uint64_t Heap::GetObjectsAllocatedEver() const {
-  return GetObjectsFreedEver() + GetObjectsAllocated();
+  uint64_t total = GetObjectsFreedEver();
+  // If we are detached, we can't use GetObjectsAllocated since we can't change thread states.
+  if (Thread::Current() != nullptr) {
+    total += GetObjectsAllocated();
+  }
+  return total;
 }
 
 uint64_t Heap::GetBytesAllocatedEver() const {