buffet: XMPP channel sockets are left behind unclosed

When an XMPP channel is closed the underlying TCP socket isn't closed
properly.

The main problem is that when we reset the connection, we do not call
NotificationChannel::Stop() to close the underlying socket. However,
chromeos::FileStream also fails to close the file descriptor in case
when Stream::Close wasn't called explicitly. And TlsStream wasn't
closing TLS session automatically if Stream::Close hasn't been called
manually. In all fairness, a stream should be closed manually, since
this is the only way to process possible errors on close, but still
we should not leak resources (like file descriptors) if the Close
hasn't been called and a stream is destroyed.

BUG=brillo:1134
TEST=`FEATURES=test emerge-link libchromeos buffet`

Change-Id: Ic71a883bc6e9e51a49249c79b4106efd0520ab68
Reviewed-on: https://chromium-review.googlesource.com/273346
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
2 files changed