Cleaned up texture memory management: textures are now shared across OpenGL contexts, and gui_textures and gui_resources are handled globally rather than per-window