Use a window to catch WM_ENDSESSION.

Rejig the watcher to run a message loop on the main thread, and to
do the blocking wait on a dedicated background thread.

BUG=412384

Review URL: https://codereview.chromium.org/848033005

Cr-Commit-Position: refs/heads/master@{#311390}
1 file changed