Qa cocci malloc

Improvement in malloc error checking test (patch 3) has lead to first patch which has been commited first to avoid a broken state in sources.
Last patch is a bit unrelated although QA related.

- PR build: https://buildbot.suricata-ids.org/builders/regit/builds/72
- PR pcaps: https://buildbot.suricata-ids.org/builders/regit-pcap/builds/10