ozone/drm: Fix single-process initialization deadlock

When ozone_platform_gbm initializes in single process mode it starts the
drm thread with a callback that posts back to the main thread a
host_drm_device_->BlockingStartDrmDevice() is called after and that
executes all the pending tasks on the current RunLoop to make sure
DrainBindingRequests executes.
Unfortunately by the time we call RunLoop on the main thread,
DrainBindingRequests might have not been posted.

This CL changes that startup logic adding a waitable event that
is signaled when the drm thread starts and then executes
DrainBindingRequests directly on the main thread.

This will let us run ozone_gl_unittests.

Bug: 831253
Change-Id: Id3d8d21361c432e73000cfe59d5cb664edb6d8d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1552107
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654207}
1 file changed