Fix folly::ThreadLocal to have unique singleton in dev builds
Summary:This re-uses StaticSingletonManager which was previously used to fix the same issue in folly::Singleton.
Because of the same issue we can no longer use static thread_local for the ThreadEntry. We now rely on pthread_getspecific/pthread_setspecific instead and use static thread_local ThreadEntry* only as a cache (to improve perf).
Reviewed By: yfeldblum
Differential Revision:
D2978526
fb-gh-sync-id:
cf1d9044afc27b62bd50a1ed931c0c420ae7107e
shipit-source-id:
cf1d9044afc27b62bd50a1ed931c0c420ae7107e