tp: add very rudimentary caching support

This CL introduces a very basic cross-cursor cache which simply stores
what its told to cache by the cursor. We preserve the existing logic
(single eq constraint seen 3 times caches sorted table) but instead
of storing in the cursor, we store in the cache.

This is necessary to unblock migration of sched and will be heavily
reworked once we have a concrete design for how we want caching to look
like.

Bug: 135177627
Change-Id: I93dda0a9fb59b91df9303efe167a3f89fdf5eff6
diff --git a/BUILD b/BUILD
index 1d891cc..a457da5 100644
--- a/BUILD
+++ b/BUILD
@@ -764,6 +764,7 @@
     srcs = [
         "src/trace_processor/sqlite/db_sqlite_table.cc",
         "src/trace_processor/sqlite/db_sqlite_table.h",
+        "src/trace_processor/sqlite/query_cache.h",
         "src/trace_processor/sqlite/query_constraints.cc",
         "src/trace_processor/sqlite/query_constraints.h",
         "src/trace_processor/sqlite/scoped_db.h",