Fail threads attaching during runtime shutdown.

Introduce counters to indicate that threads are being born. Don't allow
thread birth to occur during runtime shutdown.

Bug: 7000936

Change-Id: Ib0d78f78c0ff126a4b5d3b5a6f1a2ff8f5061ae9
diff --git a/src/utils.h b/src/utils.h
index 7daf61c..719ce57 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -298,8 +298,8 @@
 // Returns the given thread's name.
 std::string GetThreadName(pid_t tid);
 
-// Returns details of the calling thread's stack.
-void GetThreadStack(void*& stack_base, size_t& stack_size);
+// Returns details of the given thread's stack.
+void GetThreadStack(pthread_t thread, void*& stack_base, size_t& stack_size);
 
 // Reads data from "/proc/self/task/${tid}/stat".
 void GetTaskStats(pid_t tid, char& state, int& utime, int& stime, int& task_cpu);