Introduce RawThreadInfoWithMemberPermissions which will be used for "legacy" migrations + on keyserver to handle old clients + old validator.
minimallyEncodeRawThreadInfo will encode permissions and return RawThreadInfoWithMemberPermissions. Will be used along with stripPermissionsFromMemberInfo on new clients + on keyserver to handle new clients.
NOTE: This diff "introduces flow issues to resolve a flow issue. Diffs after this in stack will be about resolving minimallyEncodeRawThreadInfo-related issues.
Depends on D12556