Override CV_XADD for OSX and fix test