MEDIUM: h2: stop relying on H2_SS_IDLE / H2_SS_CLOSED

At a few places we check these states to detect if a stream has valid
data/errcode or is one of the two dummy streams (idle or closed). It
will become problematic for outgoing streams as it will not be possible
to report errors for example since the stream will switch from IDLE
state only after sending a HEADERS frame.

There is a safer solution consisting in checking the stream ID, which
may only be zero in the dummy streams. This patch changes the test to
only rely on the stream ID.
diff --git a/src/mux_h2.c b/src/mux_h2.c
index fee3d53..8254288 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -537,7 +537,7 @@
 /* marks an error on the stream */
 static inline __maybe_unused void h2s_error(struct h2s *h2s, enum h2_err err)
 {
-	if (h2s->st > H2_SS_IDLE && h2s->st < H2_SS_ERROR) {
+	if (h2s->id && h2s->st < H2_SS_ERROR) {
 		h2s->errcode = err;
 		h2s->st = H2_SS_ERROR;
 		if (h2s->cs)
@@ -1027,8 +1027,7 @@
 	memcpy(str, "\x00\x00\x04\x03\x00", 5);
 
 	write_n32(str + 5, h2c->dsi);
-	write_n32(str + 9, (h2s->st > H2_SS_IDLE && h2s->st < H2_SS_CLOSED) ?
-		  h2s->errcode : H2_ERR_STREAM_CLOSED);
+	write_n32(str + 9, h2s->id ? h2s->errcode : H2_ERR_STREAM_CLOSED);
 	ret = b_istput(res, ist2(str, 13));
 
 	if (unlikely(ret <= 0)) {
@@ -1044,7 +1043,7 @@
 	}
 
  ignore:
-	if (h2s->st > H2_SS_IDLE && h2s->st < H2_SS_CLOSED) {
+	if (h2s->id) {
 		h2s->flags |= H2_SF_RST_SENT;
 		h2s_close(h2s);
 	}