Do secondary sort of near-simultaneous transactions when generating cursor.
Do secondary sort of near-simultaneous transactions when generating cursor.

Test Plan: Unit tests.

Reviewers: mg

Differential Revision: https://review.inboxapp.com/D1325

PriviPK/privipk-sync-engine,closeio/nylas,jobscore/sync-engine,ErinCall/sync-engine,nylas/sync-engine,wakermahmud/sync-engine,Eagles2F/sync-engine,gale320/sync-engine,Eagles2F/sync-engine,PriviPK/privipk-sync-engine,ErinCall/sync-engine,Eagles2F/sync-engine,wakermahmud/sync-engine,PriviPK/privipk-sync-engine,Eagles2F/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,ErinCall/sync-engine,nylas/sync-engine,wakermahmud/sync-engine,EthanBlackburn/sync-engine,ErinCall/sync-engine,closeio/nylas,wakermahmud/sync-engine,gale320/sync-engine,PriviPK/privipk-sync-engine,nylas/sync-engine,gale320/sync-engine,gale320/sync-engine,jobscore/sync-engine,gale320/sync-engine,jobscore/sync-engine,closeio/nylas,EthanBlackburn/sync-engine,EthanBlackburn/sync-engine,wakermahmud/sync-engine,jobscore/sync-engine,PriviPK/privipk-sync-engine,EthanBlackburn/sync-engine,ErinCall/sync-engine,nylas/sync-engine,Eagles2F/sync-engine