Fix wrong output data json format when compiling with GCC

This change works around an issue when compiling with GCC where by
printing only a '\n' the produced global output is wrong. What happens
is that new lines are actually printed before the content in the
precedent fprintf calls. Hence the generated json is unparsable.

Note also that replacing the LOG macros with direct calls to fprintf
does _not_ solve the issue.

Change-Id: I2d97703cbe7703aae94def1943e2ac693945ab31
diff --git a/applications/inference_process/src/inference_process.cpp b/applications/inference_process/src/inference_process.cpp
index 7058f9c..c26bb13 100644
--- a/applications/inference_process/src/inference_process.cpp
+++ b/applications/inference_process/src/inference_process.cpp
@@ -55,10 +55,15 @@
     LOG("\"data_address\": \"%08" PRIx32 "\",\n", (uint32_t)output->data.data);
     LOG("\"data\":\"");
     for (int i = 0; i < numBytesToPrint - 1; ++i) {
-        if (i % 16 == 0 && i != 0) {
-            LOG("\n");
+        /*
+         * Workaround an issue when compiling with GCC where by
+         * printing only a '\n' the produced global output is wrong.
+         */
+        if (i % 15 == 0 && i != 0) {
+            LOG("0x%02x,\n", output->data.uint8[i]);
+        } else {
+            LOG("0x%02x,", output->data.uint8[i]);
         }
-        LOG("0x%02x,", output->data.uint8[i]);
     }
     LOG("0x%02x\"\n", output->data.uint8[numBytesToPrint - 1]);
     LOG("}");