Complete the Me2Me_Connect_LocalHost end-to-end test: verify keyboard input programatically.

BUG=134210

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226045 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 226045
Make UserInputMonitorCore listen to MessageLoop destruction to clean up before the monitoring thread message loop goes away. 
This will fix the assertion in its dtor fired on ChromeOS when the IO thread exits without running the queued tasks.

BUG=289036

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

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