BUG/MEDIUM: applet: fix reporting of broken write situation

If an applet tries to write to a closed connection, it hangs forever.
This results in some "get map" commands on the CLI to leave orphaned
connections alive.

Now the applet wakeup function detects that the applet still wants to
write while the channel is closed for reads, which is the equivalent
to the common "broken pipe" situation. In this case, an error is
reported on the stream interface, just as it happens with connections
trying to perform a send() in a similar situation.

With this fix the stats socket is properly released.
diff --git a/src/stream_interface.c b/src/stream_interface.c
index 18ff6b5..2341720 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -1343,6 +1343,14 @@
  */
 void si_applet_wake_cb(struct stream_interface *si)
 {
+	struct channel *ic = si_ic(si);
+
+	/* If the applet wants to write and the channel is closed, it's a
+	 * broken pipe and it must be reported.
+	 */
+	if ((si->flags & SI_FL_WANT_PUT) && (ic->flags & CF_SHUTR))
+		si->flags |= SI_FL_ERR;
+
 	/* update the stream-int, channels, and possibly wake the stream up */
 	stream_int_notify(si);