examples/upload.sh: fix status codes when exiting on error