Misc fixes v0.1

Misc memory handling changes.

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/158
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/78