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 4457a06 for more information.
textures: move initialization to window creation

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

Refer to 4457a06 for more information.