Log API v4.2

Rebase of https://github.com/inliniac/suricata/pull/791

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/160
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/80