Update Chat plugin to use Smack 4.0.0

The 'use-tls' property was wrongly named, because SASL != TLS. So it got
replaced with an 'accept-all-certificates' property, which, when
enabled, will make Smack accept all presented certificates.

Smack 4 throws more exceptions, as it is no longer hiding the
concurrency involved when dealing with network connections. Therefore it
was necessary to change a few catch blocks to catch Exception.

I've backported TLSUtils from Smack 4.1-SNAPSHOT. Re-licensing it (GPLv3
vs. Apache License 2.0) should be no problem, since I'm the copyright
holder for the Smack version too and willing to provide it under the
GPLv3 in Freedomotic.

Once Freedomotic switches to Smack 4.1, then TLSUtils should be remove
from the Freedomotic codebase in favor to the one provided in Smack 4.1.