Build and runtime fixes for OS X

- Fixes a build issue when using the 10.9 SDK
- Fixes a critical memory-smasher in the video gamma-setting function.