[CommCoreModule] implement C++ ThreadStore
Summary:
Grouping logic in one class to make it cleaner and reuse some code.
Depends on: D8604
Test Plan: Build iOS and Android and play with threads to make sure functionality still works.
Reviewers: michal, jon, atul, tomek
Reviewed By: tomek
Subscribers: ashoat
Differential Revision: https://phab.comm.dev/D8659