Force (host) bionic to update cached tid if necessary

1. Bionic `clone` implementation resets cached `tid` before syscall
   so that it does not get accidentally propagate to the child.
2. pthread_lock/unlock implementations do not call `gettid()` they
   instead access cached value directly from TLS. Which leads to
   a situation where cached `tid` is updated in the middle of
   `dlopen` and it fails to unlock the mutex because the
   ownership check fails. Subsequent `dlsym` (or any other
   dl* call) stops on locked mutex.

By calling `gettid()` in ResetCurrentGuestThreadAfterFork we force
bionic to set the cached value to the correct one.

Bug: http://b/289744033
Test: run guest 32bit bionic-unit-tests
Change-Id: Ia1c115c15ef3888bbcae02ebd342debc4af0103e
(cherry picked from commit 1e8e02773e1ac5f63a3c2164441caab966d2955c)
(cherry picked from commit 50633f794b153d4ddf8dd8208fe9a8632ca3979d)
1 file changed