Fix CancelationSignalTest.Cancel

The old version of the test had a bug and was racy.  If we hit a certain
code path, we would never unregister the CancelationSignal's observer,
which would result in a DCHECK.  Because the code was racy, we didn't
hit that code path very often.

This CL includes two changes.  First, it makes the test less racy.  It
ensures that we always hit the more interesting code path.  It also
fixes the bug so that hitting that code path no longer results in a
DCHECK failure.

BUG=340360

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249134 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 249134
Mojo: |Dispatcher| unfriends |CoreImpl|.

Restrict |CoreImpl|'s access to |Dispatcher| more carefully, since I'm
about to do more dangerous stuff.

R=sky@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249135 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 249135