Handle error code, stdout and stderr for prepublish script

Review URL: https://github.com/google/traceur-compiler/pull/631

Closes #631.