Use "gtar" for "tar" if available.

BSD tar on OS X doesn't handle certain packages properly,
e.g. "@". Homebrew on OS X installs gnu-tar as "gtar", so we use that
command in preference to "tar" if available.

See #1732