[graphite] Make sure we are flushing work from the Device when needed.

Specifically this adds flushing of the Device when the Device is deleted
and also when we snap a Recording, we flush all Devices connected to a
Recorder.

Bug: skia:12633
Change-Id: Idfecc8cd2a0ecf6a8d39fc81618dd6b13ec87ec2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/494243
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
3 files changed