build-setup: Use flock to setup global configs

In case multiple jobs are started simultaneously (e.g. a matrix
configuration project), the setup script will get an error on writing
the config files, e.g. git config --global will fail with:

    error: could not lock config file

Use flock to make sure they are not accessing the file simultaneously.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Ida902593995739a1b5ae7164a29221ad18c914ac
1 file changed