[MEDIUM] stream_sock: don't close prematurely when nolinger is set

When the nolinger option is used, we must not close too fast because
some data might be left unsent. Instead we must proceed with a normal
shutdown first, then a close. Also, we want to avoid merging FIN with
the last segment if nolinger is set, because if that one gets lost,
there is no chance for it to be retransmitted.
diff --git a/src/client.c b/src/client.c
index 346adc6..45c576d 100644
--- a/src/client.c
+++ b/src/client.c
@@ -418,6 +418,9 @@
 		fdtab[cfd].owner = &s->si[0];
 		fdtab[cfd].state = FD_STREADY;
 		fdtab[cfd].flags = FD_FL_TCP | FD_FL_TCP_NODELAY;
+		if (p->options & PR_O_TCP_NOLING)
+			fdtab[cfd].flags |= FD_FL_TCP_NOLING;
+
 		fdtab[cfd].cb[DIR_RD].f = l->proto->read;
 		fdtab[cfd].cb[DIR_RD].b = s->req;
 		fdtab[cfd].cb[DIR_WR].f = l->proto->write;