Avoid including vm.h header in tests.

Bug: 115484857
Change-Id: I3145826c057d28ddab2c830361a5881e4455f016
diff --git a/src/api.c b/src/api.c
index c8778cb..b3cab1a 100644
--- a/src/api.c
+++ b/src/api.c
@@ -1664,7 +1664,9 @@
 
 	if (c == '\n' || c == '\0' ||
 	    vm->log_buffer_length == sizeof(vm->log_buffer)) {
-		dlog_flush_vm_buffer(vm_locked);
+		dlog_flush_vm_buffer(vm->id, vm->log_buffer,
+				     vm->log_buffer_length);
+		vm->log_buffer_length = 0;
 	} else {
 		vm->log_buffer[vm->log_buffer_length++] = c;
 	}