Wait for all writes to complete before starting TLS in XmppSignalStrategy
When connecting XMPP socket the client sends <starttls> to the server,
waits for <proceed> response and starts TLS after that. In some cases
the first write for <starttls> may complete asynchronously, while the
<proceed> is received sychronously, which results in SSL initialization
on a socket with a pending write request. XmppSignalStrategy wasn't
handling that case correctly. Fixed it to keep track of pending write
requests and start TLS only after all write requests are finished.
BUG=499019
Review URL: https://codereview.chromium.org/
1177323003
Cr-Commit-Position: refs/heads/master@{#334246}