Add WRITE_FILE function to trace_processor

Add a function to write a blob to a file. This gives us an easy way of
writing profiles generated with EXPERIMENTAL_PROFILE into a file.

Added a new helper method OpenFstream that takes care of Windows'
special treatment of filenames (wrt character encoding). Used this new
function in ExportJson SQL function which as a bonus fixes a FILE* leak

Change-Id: I69a209d0ca17477289f3c946c85cfda0054ebe26
diff --git a/Android.bp b/Android.bp
index 5a10bef..f997118 100644
--- a/Android.bp
+++ b/Android.bp
@@ -9470,6 +9470,7 @@
         "src/trace_processor/sqlite/sql_stats_table.cc",
         "src/trace_processor/sqlite/sqlite3_str_split.cc",
         "src/trace_processor/sqlite/sqlite_raw_table.cc",
+        "src/trace_processor/sqlite/sqlite_utils.cc",
         "src/trace_processor/sqlite/stats_table.cc",
         "src/trace_processor/sqlite/window_operator_table.cc",
     ],