Fix events IntegrityError for Esper and other accounts

Summary:
Hey,

This one was super annoying. I was expecting some crazy concurrency bug with Kavya's dual-sync but in the end the bug was much more lame. EAS is actually sending us some duplicate events -- my guess is that in some cases editing an event creates a duplicate event with the exact same `UID` but different `ServerIds`. Madness.

My solution is to assume the event with the highest ServerId is the most recent one. Instead of trying to dedupe the list of events we get from EAS I chose to `flush()` the session whenever we add a new event. This solves the problem because in the case where we get a duplicate event it's considered as an update of the older event which makes the code work.

Test Plan: Tested on prod ;) More seriously, this fixed Esper's test account.

Reviewers: emfree, kav-ya

Reviewed By: kav-ya

Subscribers: spang

Projects: #eas, #sync-engine

Maniphest Tasks: T556

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