[Platform] Raise KeyUp events on focus lost

This ensures that no keys are stuck in pressed state when the user
switches away from the application window.
[X11] Fixed WindowBorder and WindowState setters

After many hours of fighting with xlib, the monster is slain and
WindowBorder/WindowState changes now take effect without messing
up the window size or position on the desktop.

Phew!