Add the ability to hook a post-archive script into the build process.

Used by the Testflight build.

The post-archive step requires nastiness to pass the result of the script
back to the caller via a temporary file. The reason for this is that a bug
in Xcode means that failures from post-archive steps do not get propagated
back to the user who called xcodebuild archive.

Also, update the postbuild script to explicitly invoke bash (so we can
avoid assuming /bin/sh is bash, and to avoid problems where executable
permissions aren't set properly).