script/librelease: add more error checking