Add ChannelEndpoint::ReplaceClient().

This must be done carefully to avoid races with all places where the
client is called outside the lock.

R=yzshen@chromium.org

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