Export DIST_DIR to soong on dist builds.

Bug: 64267858

Test: Adding DistDir to build/soong/android/variable.go enables access
      to DIST_DIR_SOONG.

Change-Id: I74faea11255edf37db6a4eaf193df300c363bfb7
diff --git a/core/config.mk b/core/config.mk
index bebc186..3f503ad 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -67,6 +67,9 @@
 
 ORIGINAL_MAKECMDGOALS := $(MAKECMDGOALS)
 
+dist_goal := $(strip $(filter dist,$(MAKECMDGOALS)))
+MAKECMDGOALS := $(strip $(filter-out dist,$(MAKECMDGOALS)))
+
 # Tell python not to spam the source tree with .pyc files.  This
 # only has an effect on python 2.6 and above.
 export PYTHONDONTWRITEBYTECODE := 1