ui/cocoa.m: Fix compatibility issue with Mac OS 10.9 and under