[lib] Refactor thread reducer
Summary:
issue: ENG-5814
We want to remove the thread related to the ks the user has logged in to / logged out of / had the cookie invalidated by.
Test Plan:
Tested that when keyserverAuthActionTypes.success is dispatched the threads are deleted and replaced with the new ones
Checked that when a user logs out the threads are deleted.
Reviewers: michal, kamil, ginsu, ashoat
Reviewed By: ashoat
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10620