xcode_emulation: work in the absence of xcodebuild

OS X systems running only the Command Line Tools for Xcode package,
without the full Xcode, don't have a functioning xcodebuild, but this
isn't mandatory for building many gyp projects (e.g. node.js, v8).
This commit handles xcodebuild failures and avoids populating
Xcode-specific CFLAGS/LDFLAGS when xcodebuild can't be run.

This has been tested on both Xcode and CLT-only systems by successfully
building node.js. The behaviour can be simulated on systems with Xcode
by setting the xcode-select path to something nonsensical, e.g.
xcode-select -switch /usr/bin

BUG=https://code.google.com/p/gyp/issues/detail?id=292
Review URL: https://codereview.chromium.org/102733012/

Patch from mistydemeo@gmail.com!

This was a manual cherry-pick from:

  https://code.google.com/p/gyp/source/detail?r=1819

Fixes #341.
v0.12.2