TLS: add detection for malicious heartbeats (AKA heartbleed)

The OpenSSL implementation of RFC 6520 (Heartbeat extension) does not
check the payload length correctly, resulting in a copy of at most 64k
of memory from the server (ref: CVE-2014-0160).
This patch adds support for decoding heartbeat messages (if not
encrypted), and checking several parts (type, length and padding).
When an anomaly is detected, a TLS event is raised.
output: clean file desc at exit.

This is a beginning of implementation for bug #1660:
 https://redmine.openinfosecfoundation.org/issues/1160

This patch adds a cleaning function for each logger of new type
(packet, tx and file). These functions are called in RunModeShutDown().

The state of this patch is that it is crashing suricata when sending
pcap to analyse:
 - At first pcap if tx and file cleaning function are called
 - At second pcap if only packet cleaning function is called

The cause in first case is unknown. In second case this is due to
the necessity of cleaning the list of logger registered to a logging
type.
unified2: fix memory leak at shutdown

Module didn't properly free output context at shutdown. Led to a leak
in Unix Socket mode.
output: add Disable funcs to mirror Enable

For the loggers that we allow only one instance for: tls, ssh, drop, we
track active loggers through Output*Enable functions. Add Disable
functions to mirror this. They are to be called from the shutdown funcs
those loggers use.
drop loggers: call disable func

Call OutputDropLoggerDisable() on cleanup.
log-tls: run Disable at shutdown

Call OutputTlsLoggerDisable at cleanup.
alert-json: fix cleanup

Call specialized clean up function when running as a sub-module.
dns-json: fix cleanup

Use specialized cleanup function for sub-module case. Freeing the
LogFileCtx is not the responsibility of a sub-module.
file-json: cleanup at shutdown

Fix a memory leak at shutdown. Module didn't have a cleanup function.
http-json: add missing cleanup functions

Add cleanup functions.
ssh-json: add clean up functions

Add clean up functions for the SSH json logger.
eve-log: fix mem leak at shutdown

Make sure we free all memory in the shutdown function.
drop-json: fix cleanup

Use proper function for sub-module cleanup. LogFileCtx is not managed
by the sub-module, so don't clean it.
tls-json: add cleanup function

Properly clean up output context when shutting down.
output api: complete shutdown functions

Add missing function for Filedata API. Clean up list in all functions.
output-api: cleanup handling

Add output 'free list' that contains all the output ctx' that need
cleanup at shutdown. It differs from the runmode output list in that
it will also contain a 'parent' for the submodules that share the
context of it's parent.
Merge remote-tracking branch 'upstream/master'