Synchronize IDAStub with discardable handle registration.

This CL modifies ImageDecodeAcceleratorStub so that completed decodes
are processed only after we're sure that the buffer of a discardable
handle corresponding to a decode request is registered in the transfer
buffer manager. This requires introducing a sync token that is inserted
in the command buffer after requesting the creation of the discardable
handle in the client.

The release count of this new sync token is plumbed from the client to
the service and a test is added to verify the new behavior.

Test: added unit test for the new behavior.
Bug: 868400
Change-Id: If9dcddc6ebdaea4e28433bf582d9e5fbaa251bd2
Reviewed-on: https://chromium-review.googlesource.com/c/1460058
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Sunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#631871}
8 files changed