MEDIUM: stream-int: remove dangerous interval checks for stream-int states

The stream interface state checks involving ranges were replaced with
checks on a set of states, already revealing some issues. No issue was
fixed, all was replaced in a one-to-one mapping for easier control. Some
checks involving a strict difference were also replaced with fields to
be clearer. At this stage, the result must be strictly equivalent. A few
tests were also turned to their bit-field equivalent for better readability
or in preparation for upcoming changes.

The test performed in the SPOE filter was swapped so that the closed and
error states are evicted first and that the established vs conn state is
tested second.
diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h
index 64aa9af..59b5c15 100644
--- a/include/proto/stream_interface.h
+++ b/include/proto/stream_interface.h
@@ -184,7 +184,7 @@
 		cs_destroy(cs);
 	}
 	else if ((appctx = objt_appctx(si->end))) {
-		if (appctx->applet->release && si->state < SI_ST_DIS)
+		if (appctx->applet->release && !si_state_in(si->state, SI_SB_DIS|SI_SB_CLO))
 			appctx->applet->release(appctx);
 		appctx_free(appctx); /* we share the connection pool */
 	} else if ((conn = objt_conn(si->end))) {
@@ -238,7 +238,7 @@
 	struct appctx *appctx;
 
 	appctx = objt_appctx(si->end);
-	if (appctx && appctx->applet->release && si->state < SI_ST_DIS)
+	if (appctx && appctx->applet->release && !si_state_in(si->state, SI_SB_DIS|SI_SB_CLO))
 		appctx->applet->release(appctx);
 }
 
@@ -448,13 +448,13 @@
  */
 static inline void si_chk_rcv(struct stream_interface *si)
 {
-	if (si->flags & SI_FL_RXBLK_CONN && (si_opposite(si)->state >= SI_ST_EST))
+	if (si->flags & SI_FL_RXBLK_CONN && si_state_in(si_opposite(si)->state, SI_SB_EST|SI_SB_DIS|SI_SB_CLO))
 		si_rx_conn_rdy(si);
 
 	if (si_rx_blocked(si) || !si_rx_endp_ready(si))
 		return;
 
-	if (si->state != SI_ST_EST)
+	if (!si_state_in(si->state, SI_SB_EST))
 		return;
 
 	si->flags |= SI_FL_RX_WAIT_EP;
@@ -472,7 +472,7 @@
 {
 	struct conn_stream *cs;
 
-	if (si->state != SI_ST_EST)
+	if (!si_state_in(si->state, SI_SB_EST))
 		return 0;
 
 	cs = objt_cs(si->end);