[lib] refactor thread activity reducer to use sqlite operations
Summary:
Refactor the thread activity reducer to use sqlite operations
Depends on D11576
Test Plan: Passing existing thread activity reducer tests. Actual sqlite operations are tested later in stack.
Reviewers: kamil, atul, ginsu
Reviewed By: atul
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11578