Support preemptive caching for asynchronous mutations.

Previously, all mutation requests would be dropped if busy running a mutation cycle. A pair of notifications were triggered to mark the start and end of the mutation cycle.

With the patch:

- Async requests have the option of being dropped or queued. Non-critical cycles are dropped when busy. Important requests (i.e. pending tree mutations) are queued.
- Simplifies the status notification APIs by using a return value and callback instead of client notifications. This change makes it easier to have different behavior for active and pending tree mutations without the dispatcher being aware of the details.
- Simplifies tests to reduce number of threads involved in async mutation tests to simplify debugging.
- Tests queuing strategies.

Bug: 791280
Change-Id: I604dba5ef0ca840d9b8d42eb41a6fc69b0b8e366
Reviewed-on: https://chromium-review.googlesource.com/c/1467923
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Majid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633896}
6 files changed