Reland of Only release the pointer lock when the RenderWidgetHost being destroyed (patchset #1 id:1 of https://codereview.chromium.org/2763953003/ )

Reason for revert:
Relanding with the test disabled on Mac.

Original issue's description:
> Revert of Only release the pointer lock when the RenderWidgetHost being destroyed (patchset #1 id:1 of https://codereview.chromium.org/2760343002/ )
>
> Reason for revert:
> Looks like this breaks PointerLockBrowserTest.PointerLockChildFrameDetached: https://uberchromegw.corp.google.com/i/chromium.memory/builders/Mac%20ASan%2064%20Tests%20%281%29/builds/28142
>
> Original issue's description:
> > Only release the pointer lock when the RenderWidgetHost being destroyed
> > is the one holding the pointer lock.
> >
> > This fixes a crash where the WebContents would stop tracking which
> > RenderWidgetHost was holding the pointer lock.
> >
> > BUG=703284
> >
> > Review-Url: https://codereview.chromium.org/2760343002
> > Cr-Commit-Position: refs/heads/master@{#458446}
> > Committed: https://chromium.googlesource.com/chromium/src/+/bf846a94da5c2b4f8ff93a7942d3d50799381675
>
> [email protected],[email protected],[email protected]
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=703284
>
> Review-Url: https://codereview.chromium.org/2763953003
> Cr-Commit-Position: refs/heads/master@{#458539}
> Committed: https://chromium.googlesource.com/chromium/src/+/a2fda5591832a96af3146f6a3db8cb9b947c2a86

[email protected],[email protected],[email protected]
BUG=703284

Review-Url: https://codereview.chromium.org/2764703004
Cr-Commit-Position: refs/heads/master@{#458692}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 093f1f22..b165369 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1739,7 +1739,7 @@
       view_->RestoreFocus();
   }
 
-  if (mouse_lock_widget_)
+  if (render_widget_host == mouse_lock_widget_)
     LostMouseLock(mouse_lock_widget_);
 }