BUG/MEDIUM: stream_interface: don't close outgoing connections on shutw()

Commit 7bb68abb introduced the SI_FL_NOHALF flag in dev10. It is used
to automatically close the write side of a connection whose read side
is closed. But the patch also caused the opposite to happen, which is
that a simple shutw() call would immediately close the connection. This
is not desired because when using option abortonclose, we want to pass
the client's shutdown to the server which will decide what to do with
it. So let's avoid the close when SHUTR is not set.
diff --git a/src/stream_interface.c b/src/stream_interface.c
index ecd7e4c..8a21d39 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -297,7 +297,13 @@
 			if (conn->xprt && conn->xprt->shutw)
 				conn->xprt->shutw(conn, 1);
 
-			if (!(si->flags & SI_FL_NOHALF)) {
+			/* If the stream interface is configured to disable half-open
+			 * connections, we'll skip the shutdown(), but only if the
+			 * read size is already closed. Otherwise we can't support
+			 * closed write with pending read (eg: abortonclose while
+			 * waiting for the server).
+			 */
+			if (!(si->flags & SI_FL_NOHALF) || !(si->ib->flags & (CF_SHUTR|CF_DONT_READ))) {
 				/* We shutdown transport layer */
 				if (conn->ctrl)
 					shutdown(si->conn->t.sock.fd, SHUT_WR);