Make all scripts OUT_DIR_COMMON_BASE gnostic

This patch add fucntionality to mimic the environment varible added to
AOSP by JBQ; here goo.gl/GVT7Xl .

Previously, and without this, a build initiated by our build-pac.sh
script would work until the initial compilation would complete, upon
starting the optimizing and final zip creation it would fail to find the
OUT directory only looking directly in the source folder.

With this patch, if OUT_DIR_COMMON_BASE is null/undefined in .bashrc the
use functions the exact same as if the patch were not present, when it
is defined it returns 1 causing the patch to use OUT_DIR_COMMON_BASE as
OUT_DIR.

PS1: Initial Patch, Much hacks, Fix builds for self; Unsure if work for
others.
PS2: Actually make this function, less hacks; should work no mater what.

TODO:
1. Re-word patch message.
2. Submit patch.

Change-Id: Ia224bcbf87070664cc174c2fb597590f66893b35