[server] Avoid creating duplicated sidebars and return existing id instead
Test Plan:
Open two emulators and login as two different users:
Open pending personal thread on both devices and send a message to it: only one personal thread should be created and displayed on both clients with two messages.
Open pending sidebar on both devices, where source message is created by user A. Send messages to it, at almost the same time, but first on B's device. Sidebar should be created and displayed with both messages.
Open pending sidebar on both devices, where source message is created by user A. Send messages to it, at almost the same time, but first on A's device. Sidebar should be created and displayed on both devices. It should contain only A's message. B should see a button which allows to join a thread. This is caused by a fact that A created the sidebar with only A as members and B have to join it before sending any messages.
Reviewers: ashoat
Reviewed By: ashoat
Subscribers: KatPo, Adrian, atul
Differential Revision: https://phabricator.ashoat.com/D1000