script: fix display of curl errors