Get GenericScopedHandle::Set to preserve LastError code

Code like this is elegant and clean and common in Chrome:

  event_.Set(CreateEvent(NULL, FALSE, FALSE, wname.c_str()));
  if (event_.Get() && GetLastError() != ERROR_ALREADY_EXISTS) {

However it will behave incorrectly if event_.Set() zeroes out the
Windows LastError code, which VC++ 2015 frequently does. This change
avoids that.

R=rvargas@chromium.org
BUG=528394,529981,440500

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

Cr-Commit-Position: refs/heads/master@{#348324}
4 files changed