spec.sh: check return value of wait command