[vm] Eagerly flush logs on Android
[vm] Eagerly flush logs on Android

Android truncates on 1023 characters, flush more eagerly.
Flush on newlines, otherwise Android inserts newlines everywhere.

Closes: https://github.com/dart-lang/sdk/issues/47332

TEST=Manually tested in Flutter custom engine build.

Change-Id: Ie559636f49903cd6a9c4729b870674b3b12804c8
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-kernel-precomp-android-release-arm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215060
Reviewed-by: Slava Egorov <72c81f38df725d8f1832acb9b5bb99563fc2f1b9@google.com>
Commit-Queue: Daco Harkes <930cbae0ca77f1954c53e32620d89cfcca318f00@google.com>

dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk,dart-lang/sdk