Restore app keyboard focus after closing dialogs on OSX

This fixes #2318 (the fileOpenSaveExample didn't get keyboard focus after dismissing the dialog windows)

It also makes the native window / context getters into virtual functions.

cc @arturoc @oftheo