[clang-scan-deps] Move command-line generation out of critical section (#158187)
The first call to getBuildArguments() can be costly. Although the
original author’s comment (from commit 3b1a686) states that it should
be called outside the critical section, it is currently invoked within
the locked region.
This change moves it outside the critical section to match the original
intent and reduce lock contention.