move count decrement after success sent

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c
index 40ac476..e1e52cb 100644
--- a/library/ssl_tls13_server.c
+++ b/library/ssl_tls13_server.c
@@ -2654,10 +2654,6 @@
 
     MBEDTLS_SSL_DEBUG_MSG( 2, ( "=> prepare NewSessionTicket msg" ) );
 
-    if( ssl->handshake->resume == 1 )
-        ssl->handshake->new_session_tickets_count = 0;
-    else
-        ssl->handshake->new_session_tickets_count--;
 #if defined(MBEDTLS_HAVE_TIME)
     session->start = mbedtls_time( NULL );
 #endif
@@ -2870,6 +2866,8 @@
         MBEDTLS_SSL_PROC_CHK( mbedtls_ssl_finish_handshake_msg(
                                   ssl, buf_len, msg_len ) );
 
+        ssl->handshake->new_session_tickets_count--;
+
         mbedtls_ssl_handshake_set_state( ssl,
                                          MBEDTLS_SSL_NEW_SESSION_TICKET_FLUSH );
     }