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/parser_yin.c b/src/parser_yin.c
index c13ce60..171fb36 100644
--- a/src/parser_yin.c
+++ b/src/parser_yin.c
@@ -3818,6 +3818,9 @@
 
     /* skip possible trailing whitespaces at end of the input */
     while (isspace(in->current[0])) {
+        if (in->current[0] == '\n') {
+            LY_IN_NEW_LINE(in);
+        }
         ly_in_skip(in, 1);
     }
     if (in->current[0]) {
@@ -3878,6 +3881,9 @@
 
     /* skip possible trailing whitespaces at end of the input */
     while (isspace(in->current[0])) {
+        if (in->current[0] == '\n') {
+            LY_IN_NEW_LINE(in);
+        }
         ly_in_skip(in, 1);
     }
     if (in->current[0]) {