fix release-build git dir usage

(I'd thought --git-dir was an alternative to `cd`ing, but
actually it sets only the metadata directory and treats
the current directory as the git working directory.)
release-build.py: fix Python 2.6 compatibility
release-build: add (limited) OS X support