Check for unused variables in GN.

A check for unused variables was missing for some helper functions.
The main thing that this affects is the "config" function, where
people were confused when setting deps or configs didn't work the
way they expected (because they were unused).

BUG=392026
R=dpranke@chromium.org

Review URL: https://codereview.chromium.org/399143006

Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a425c0d7d5acb3f1a47eef0639e436ff60522ba5
diff --git a/tools/gn/functions.cc b/tools/gn/functions.cc
index e973f2e..35e42d4 100644
--- a/tools/gn/functions.cc
+++ b/tools/gn/functions.cc
@@ -739,8 +739,13 @@
     block->ExecuteBlockInScope(&block_scope, err);
     if (err->has_error())
       return Value();
-    return found_function->second.executed_block_runner(
+
+    Value result = found_function->second.executed_block_runner(
         function, args.list_value(), &block_scope, err);
+
+    if (!block_scope.CheckForUnusedVars(err))
+      return Value();
+    return result;
   }
 
   // Otherwise it's a no-block function.