Add `set -o pipefail` for bash 3+