app: Port to gtk-mac-integration

Replace deprecated Carbon APIs with Cocoa.

Includes code by:
Simone Karin Lehmann
Michael Natterer
Daniel Sabo

(cherry picked from commit e56344294c90e1ba97de5c134b50c4c522f0808f)