Use mmap to create the pthread_internal_t.

Bug: 16847284
Change-Id: I488fa236f57aa3acb29b4ffbbab2fab51b0653be
Count references for groups instead of instances

  Count references on the group level to avoid
  partially unloading function that might be
  referenced by other libraries in the local_group

  Bonus: with this change we can correctly unload recursively
  linked libraries. is_recursive check is removed.

  Also dynamic executables (not .so) with 0 DT_NEEDED libraries
  are now correctly linked.

Change-Id: Idfa83baef402840599b93a875f2881d9f020dbcd
Merge "Count references for groups instead of instances"
Merge "Use mmap to create the pthread_internal_t."