Stream alert fix

Here's a small patchset. First patch is improving the prelude alerting. And the second is a code factorization.

PR builds:
- PR build: https://buildbot.suricata-ids.org/builders/regit/builds/93
- PR pcaps: https://buildbot.suricata-ids.org/builders/regit-pcap/builds/32