[Metal] Add option to wait until command buffers are scheduled.

Flutter is seeing issues with background iOS apps. They have a mutex
that guards against Skia being called when in background, but there's
a slim possibility of a command buffer being committed, returning
control to Flutter, then Flutter entering background before that command
buffer is scheduled.

Change-Id: I6bd7afd8ce650b85d7c6b3a0af10cffdcc99e374
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/575667
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
(cherry picked from commit b838c9b66d3bf5c89b971000b0df1fedfad68efa)
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/597196
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2 files changed