Bug1160 log api cleanup v1

Builds on https://github.com/inliniac/suricata/pull/925. Lightly tested.

Adds missing cleanups, fixes broken cleanups.

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/256
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/175