tls log: add JSON output

This patch adds a new json option to tls logging. If set to yes, it
output TLS logging information in JSON format.
fix compile errors in original TLS JSON stuff
TLS logging using libjansson with syslog