Fixes v2

Summary:
- Coverity fixes
- https://github.com/inliniac/suricata/pull/846
- https://redmine.openinfosecfoundation.org/issues/1108

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/201
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/121