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}


CrOS-Libchrome-Original-Commit: 84f30fe06877193d39bb2cb9fe345c2e12e695b3
diff --git a/base/base.gyp b/base/base.gyp
index 09ab7de..ce778f6 100644
--- a/base/base.gyp
+++ b/base/base.gyp
@@ -655,6 +655,7 @@
         'win/registry_unittest.cc',
         'win/scoped_bstr_unittest.cc',
         'win/scoped_comptr_unittest.cc',
+        'win/scoped_handle_unittest.cc',
         'win/scoped_process_information_unittest.cc',
         'win/scoped_variant_unittest.cc',
         'win/shortcut_unittest.cc',