Fix crash in AppLayer Proto Detect

The App Proto Detect code would use the wrong pattern count to
index a results array, leading to SEGVs.

Bug #1080.

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/144
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/64