Fix build on Mac OS X > 10.6

Changes backported from osg upstream