CMake: Just assume Apple platforms have Cocoa support.

Fixes Bugzilla #2056.
Free the correct variable.