BUG/MINOR: peers: Use right channel flag to consider the peer as connected

When a peer open a new connection to another peer, it is considered as
connected when the hello message is sent. To do so, the peer applet was
relying on CF_WRITE_PARTIAL channel flag. However it is not the right flag
to use. This one is a transient flag. Depending on the scheduling, this flag
may be removed by the stream before the peer has a chance to see
it. Instead, CF_WROTE_DATA flag must be checked.

This patch is related to the issue #1799. It must be backported as far as
2.0.

(cherry picked from commit 642170a653d1587572fbce010156b49923f06947)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit 843ccf4d569218b29241ea4e799251e14e12272e)
[wt: sc -> si in 2.5]
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit c74d7aadc556d19b412dc4a4f3a625916bda4fa0)
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/peers.c b/src/peers.c
index 5ae9614..4a0efb9 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -2675,7 +2675,7 @@
 					}
 				}
 
-				if (si_ic(si)->flags & CF_WRITE_PARTIAL)
+				if (si_ic(si)->flags & CF_WROTE_DATA)
 					curpeer->statuscode = PEER_SESS_SC_CONNECTEDCODE;
 
 				reql = peer_getline(appctx);