files: move initialization to window creation

Instead of initializing lazily, initialize when the first window is
created and deinitialize on application exit.

This allows us to nicely contain all the initialization logic to one
place and avoid possible performance hiccups when initializing in the
middle of something important.
files: throw an exception if used uninitialized
windows: fix static initialization order issues

Concerns the 'all_windows' and 'open_windows' static variables.
contexts: move initialization to window creation

Refer to 4457a0 for more information.
textures: move initialization to window creation

Refer to 4457a0 for more information.
ui: move initialization to window creation

Refer to 4457a0 for more information.