Make finish flush procs work with GL.

This will be required for async readback support.

This is implemented using sync objects when available and otherwise
calls glFinish.

Relaxes the unit test requirement that providing a callback with no
work to flush always calls the proc immediately.

Bug: skia:8962
Change-Id: Ieefcab6dccc3924e50260343f01904e7303bb12b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212198
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
9 files changed