wpa_passphrase writes its error messages to stdout, so this needs to
tee so that errors are visable to user. Also need to enable pipefail
so that the error code still gets caught.
* Made more specific shellcheck disables
* Fixed variable quoting (SC2086,SC2064)
* Use `$*` expansion instead of `$@` when not using arrays (SC2124)
* Use cleaner `$()` syntax instead of back quotes (SC2006)
* Improved comparator (SC2166)
* Minor improvements in coding style
Tested clean output using: `find -name "*.sh" | xargs -n1 shellcheck -x`.