Catch common errors in tor bash scripts
Let's gradually convert our scripts to use:
set -e set -u set -o pipefail
These settings help catch common errors in bash scripts at runtime: http://redsymbol.net/articles/unofficial-bash-strict-mode/
(Shellcheck helps us catch errors while writing scripts, but it can't help with runtime failures.)
Follow-up to legacy/trac#33451 (moved).