get-stack.sh: improve error checking (fixes #2973)
get-stack.sh: improve error checking (fixes #2973)

anton-dessiatov/stack,mrkkrp/stack,anton-dessiatov/stack,juhp/stack,MichielDerhaeg/stack,Fuuzetsu/stack,juhp/stack,Fuuzetsu/stack,martin-kolinek/stack,MichielDerhaeg/stack,mrkkrp/stack,martin-kolinek/stack