Reduce multithreading of run-test builds.

The build system will build many shards in parallel, so try to use
just one core per shard in that situation to lower the system load.

However, at the same time, try to use all the cores if we are just
iterating on single test, and thus build only one shard at a time.

I tested that the build time of both uses is same as before,
while reducing the number processes executed in parallel.

Test: time m art-run-test-{jvm,host,target}-data
Test: time m art-run-test-{jvm,host,target}-data-shard00
Change-Id: I9e656d9980feeb5a0acbc91ae37162461a920f5f
1 file changed