base: windows: make Event wait() actually infinite
base: windows: make Event wait() actually infinite

Refactor the Windows PlatformEvent wait and wait_timeout functions to
use an internal wrapper function that correctly handles waiting forever
by passing the INFINITE value to WaitForSingleObject.

Previously, the wait function used a Duration value of i64::MAX seconds,
which becomes 0xfffffc18 when converted to milliseconds and truncated to
a DWORD. This does not correspond to the INFINITE value (-1, 0xffffffff)
that the Win32 Wait* functions expect, so theoretically a wait() call
could have returned without the event being signaled.

BUG=b:231344063
TEST=tools/presubmit --all

Change-Id: If68c4b2518926c12e8caf6746ef4b0bb152be00d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3966485
Commit-Queue: Daniel Verkamp <72bc170b46ec491f7bdd4359a1c0bfed274de40c@chromium.org>
Reviewed-by: Noah Gold <2d4550d8af93bfc6e6fbe1fb1b0cc97a9ee7c3ce@google.com>

google/crosvm,google/crosvm,google/crosvm,google/crosvm