Install: fail on incomplete download and clean up tempfile (#2608)
Install: fail on incomplete download and clean up tempfile (#2608)

- Fail when the connection closes before the response is complete
- Create tempfile only when needed, and clean it up on failure
lovell/sharp,lovell/sharp,lovell/sharp,lovell/sharp,lovell/sharp,lovell/sharp