new_variant: return error code if build fails

If the build (launched by fails, return an error
code after cleaning up as much as possible.

TEST=See testdata/ for full details.
Use `&&` to run a second command if the first one passes.
`cd testdata ; ./ hatch && echo PASS`
`cd testdata ; ./ waddledoo && echo PASS`
The case with hatch will show "PASS" but because waddledoo has an
issue right now, that line won't show the "PASS".

Change-Id: I6cceeff7127ba93e0bd99d186d3cb1dfca44fcf0
Tested-by: Paul Fagerburg <>
Reviewed-by: Jacob Rasmussen <>
Reviewed-by: Greg Edelston <>
Commit-Queue: Paul Fagerburg <>
1 file changed