input CHANGE optimize newlines counting in input handler

Moves counting newlines from input handler functions to the parsers
which have much better idea about the content of the data beeing
processed and can better optimize counting newlines. Counting newlines
in the input handler functions mostly caused reading data twice.
diff --git a/src/json.c b/src/json.c
index eca191e..5bcb852 100644
--- a/src/json.c
+++ b/src/json.c
@@ -71,6 +71,9 @@
 {
     /* skip leading whitespaces */
     while (*jsonctx->in->current != '\0' && is_jsonws(*jsonctx->in->current)) {
+        if (*jsonctx->in->current == '\n') {
+            LY_IN_NEW_LINE(jsonctx->in);
+        }
         ly_in_skip(jsonctx->in, 1);
     }
     if (*jsonctx->in->current == '\0') {