Mojo: Eliminate some "cross-process" "simultaneous"-close races.

Don't detach an endpoint from a channel, unless the remote has sent us a
message (kSubtypeMessagePipePeerClosed) that it has gone away. In
particular, detach early -- even if the local side has gone away.

There is no way to detach early safely, since we might conceivably end
up reusing the ID (and then getting stale messages).

(This "commonly" caused a CHECK failure in EmbedderTest.ChannelsBasic,
but it can actually be reproduced in-process, communicating over a real
pipe. There are other, non-asserting situations in which you'd get a
"Received a message for nonexistent local destination ID <n>" warning.
These are other aspects of the same bug.)

R=darin@chromium.org
BUG=335274

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

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