stream: improve retransmission handling

Improve retransmission handling in the CLOSE_WAIT state.

Bug #1180. https://redmine.openinfosecfoundation.org/issues/1180

Prscript:
- PR build: https://buildbot.suricata-ids.org/builders/inliniac/builds/277
- PR pcaps: https://buildbot.suricata-ids.org/builders/inliniac-pcap/builds/195