ART: Do not recursively abort when visiting locks in a bad state

This avoids a nested abort in VisitLocks.

Bug: 17080621, 16382675
Change-Id: Id604976ac9dcac0e319fb25cab4d2cbc98d7ee24
diff --git a/runtime/monitor.h b/runtime/monitor.h
index ae14fc1..a94295a 100644
--- a/runtime/monitor.h
+++ b/runtime/monitor.h
@@ -88,8 +88,10 @@
 
   // Calls 'callback' once for each lock held in the single stack frame represented by
   // the current state of 'stack_visitor'.
+  // The abort_on_failure flag allows to not die when the state of the runtime is unorderly. This
+  // is necessary when we have already aborted but want to dump the stack as much as we can.
   static void VisitLocks(StackVisitor* stack_visitor, void (*callback)(mirror::Object*, void*),
-                         void* callback_context)
+                         void* callback_context, bool abort_on_failure = true)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   static bool IsValidLockWord(LockWord lock_word);