Replace the unportable trap .. ERR in regression tests.

Use a simple return value ($?) test instead of trapping the ERR fake
signal that is only available in Ksh.