Clean up package restoration in CoreCLR test build (dotnet/coreclr#27633)
During investigation of package version issues in consolidation
scouting I noticed that package restoration logic in the test build
script is quite silly: we first restore all packages but ignore the
exit code, subsequently we restore all packages again before
building each test chunk and fail if we're unable to.
I have simplified this so that we properly exit when we fail to
restore packages upfront; after that, we no longer need to restore
packages before building each test chunk.
Thanks
Tomas
Commit migrated from https://github.com/dotnet/coreclr/commit/
933e8f07e4346baef486d3aebc2339a29dd8a8ec