bug #987, bug #989

Fix bug in app layer protocol detection, stream reassembly.

Wrt stream reassembly fix, I haven't updated inline reassembly.. Can you have a look at that? IF you can't I will update that as well.

https://buildbot.suricata-ids.org/builders/poona/builds/15

Once I am done finshing my next upgrade of app parser engine and the yaml parser configuration, I will refactor/update the protocol detection code. I can write a nice state machine out of it.