Added a HasFocus() method to the Os interface.

It is properly implemented on darwin, stubs that always return true are in place on linux and windows.
This prevents the input system from generating events when the application is not in focus, and it
allows the input system to automatically release all keys when focus is lost.