build-ios.sh: A couple of minor tweaks and adjustments.

"set -e" causes the shell to silently exit without comment under
some circumstances, so add a trap that catches that and diagnoses
what failed. Also, the usual build path can get quite far before
reporting that the SIGN_IDENTITY value isn't usable; check for that
right away up front, and error out then, rather than running a
long build first. A couple of minor tweaks to the argument processing,
also.

The reason to change the $# loop is that if you didn't pay attention
to the usage description,
	build-ios.sh --disable-foo
produces a very strange error message from the Ruby command, because
we end up with Ruby trying to parse "--disable-foo" as a command-line
option. (I think a -- might fix this, but went for a more explicit
check on arguments anyway.)