Fix type_into_keyboard on OS X. When the application is in the background, NSApplication has a nil -mainWindow.
Fix type_into_keyboard on OS X. When the application is in the background, NSApplication has a nil -mainWindow.

TestingWithFrank/Frank,quamotion/Frank,soundcloud/Frank,TestingWithFrank/Frank,pskrz/Frank,quamotion/Frank,quamotion/Frank,Weeman360/frank-cucumber-pitchin,moredip/Frank,moredip/Frank,pskrz/Frank,TestingWithFrank/Frank,soundcloud/Frank,Weeman360/frank-cucumber-pitchin,pskrz/Frank,Weeman360/frank-cucumber-pitchin,Weeman360/frank-cucumber-pitchin,soundcloud/Frank