Return exit code 1 for failures

Return exit code 1 if any error is encountered during build or usage.

Move creation of temporary directory from STI main down into the build
and usage functions.

Fixes #135