[MacPlatform] Fix modal window detection in Yosemite.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=21148
Merge pull request #659 from bratsche/backport-21148-to-5.5

[MacPlatform] Fix modal window detection in Yosemite.