DAG improvements

Rebase of https://github.com/inliniac/suricata/pull/949

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/279
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/197