Make build script Mac-friendly

- Set the DLYD_LIBRARY_PATH when building V8 such that building the
  snapshot doesn't fail
- Use appropriate extensions for shared libraries when copying etc
  (dylib for Mac OS, so for Linux)
- Set appropriate dylib install names if on Mac OS. There may be a
  better way to do that during the build of V8 but Gyp.