Enable the client to call SSL_read() without stopping the ability to call SSL_write_early()

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2737)
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index 2c202f4..a1807f2 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -168,6 +168,13 @@
     return 1;
 }
 
+void ossl_statem_check_finish_init(SSL *s, int send)
+{
+    if ((send && s->statem.hand_state == TLS_ST_CW_PENDING_EARLY_DATA_END)
+            || (!send && s->statem.hand_state == TLS_ST_CW_EARLY_DATA))
+        ossl_statem_set_in_init(s, 1);
+}
+
 void ossl_statem_set_hello_verify_done(SSL *s)
 {
     s->statem.state = MSG_FLOW_UNINITED;