Finish initial implementation of window timers in Linux/X11.

Timer events do not work in the Windows build, but they will be
implemented in the next commits.