Add secondary counter in place of tls_nodelete flag

The tls_nodelete state should apply to load_group not
isolated soinfo. This actually also means that multiple
soinfos may have tls_counter on their dso_handles.

This change replaces TLS_NODELETE flag with secondary counter.
Note that access to the secondary counter (located inside soinfo)
is pretty expensive because it requires soinfo lookup by dso_handle
whereas dso_handle counter is much faster. This is why it is updated
only when dso_handle counter starts or hits 0.

Bug: http://b/80278285
Test: bionic-unit-tests --gtest_filter=dl*
Change-Id: I535583f6714e45fa2a7eaf7bb3126da20ee7cba9
diff --git a/linker/linker_soinfo.h b/linker/linker_soinfo.h
index 6e1f005..09e5065 100644
--- a/linker/linker_soinfo.h
+++ b/linker/linker_soinfo.h
@@ -51,7 +51,7 @@
                                          // when load group is crossing
                                          // namespace boundary twice and second
                                          // local group depends on the same libraries.
-#define FLAG_TLS_NODELETE     0x00000200 // This flag set when there is at least one
+#define FLAG_RESERVED         0x00000200 // This flag was set when there is at least one
                                          // outstanding thread_local dtor
                                          // registered with this soinfo. In such
                                          // a case the actual unload is
@@ -260,8 +260,6 @@
   void set_linker_flag();
   void set_main_executable();
   void set_nodelete();
-  void set_tls_nodelete();
-  void unset_tls_nodelete();
 
   size_t increment_ref_count();
   size_t decrement_ref_count();