cocoa_common: check if the screen has a menubar in a more generic way

Fixes #274