Make vending of sync IDs (tab_node_id) more explicit

Prior to this patch, it was buried in GetTabNodeFromLocalTabId() which
sometimes made a lookup only (if the tab ID was already associated) and
some other times vended a new sync ID (via
TabNodePool::AssociateWithFreeTabNode()).

We refactor the APIs to surface this logic more explicitly in the only
calling site, in LocalSessionEventHandlerImpl.

As a bonus point, a related test is added to SessionSyncBridgeTest,
which also passes prior to this patch.

Bug: 843554
Change-Id: Ie9a2b136dbfb631e43d3abf2c345c07036670eb9
Reviewed-on: https://chromium-review.googlesource.com/1071572
Reviewed-by: Marc Treib <[email protected]>
Commit-Queue: Mikel Astiz <[email protected]>
Cr-Commit-Position: refs/heads/master@{#561478}
8 files changed