cli: do not perform redundant work
cli: do not perform redundant work

Move build_dir and uow construction out of this loop. They can be reused.

PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild,PolyJIT/benchbuild