Fix/refactor tcaches synchronization.

Synchronize tcaches with tcaches_mtx rather than ctl_mtx.  Add missing
synchronization for tcache flushing.  This bug was introduced by
1cb181ed632e7573fb4eab194e4d216867222d27 (Implement explicit tcache
support.), which was first released in 4.0.0.

(cherry picked from commit 3ecc3c84862ef3e66b20be8213b0301c06c692cc)

Bug: 35867477

Test: Booted angler using normal config and svelte config.
Test: Ran bionic unit tests/jemalloc tests.
Test: Ran the art ThreadStress tests on the normal config/svelte config.
Change-Id: I8de25e7eae8f0b055febafee1b5e4d170371bbcd
6 files changed