Improve error handling.

Bail out as soon as something goes wrong. Previously if we failed early,
we'd obliterate the existing version anyway.

Don't remove the temporary directory on failure. Otherwise there's no
way to debug a failure.

Bug: N/A
Test: updated external/curl
Change-Id: I3bf055a8ec514c7b76683baee8e1540deb5a3e5d
3 files changed