updating logic to report missing body error.
Merge pull request #406 from npm/bcoe/body-error-hotfix

hot-fix for bad handling of downloads-api error.
install.sh: Handle redirects properly

Also strips some bashisms

Fixes #415
Merge pull request #416 from npm/curlsh

install.sh: Handle redirects properly