cocoa: fix some pointer casts to be 32bit safe

credits: wm4