[GCM] Add heartbeat manager and reconnection logic due to heartbeat failure
The heartbeat manager maintains the heartbeat timer, handles heartbeat
interval updates from the server, and automatically triggers connection resets
if the heartbeat isn't properly acknowledged in a timely manner.
Also fixes an issue in reconnection where the client socket handle doesn't deal
well with a connection reset due to passing ownership of the socket.
BUG=284553
Review URL: https://codereview.chromium.org/
118133003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242848 0039d316-1c4b-4281-b951-d872f2087c98