Fix potential memory leak when resizing images
Fix some static analysis bugs

- Add missing variables to init lists
- Prevent cases where divide-by-zero could happen
- Display errors for filesystem functions
Avoid using temporary string after deconstruction

This duplicates the window title string to a regular C string so that we
don't have to worry if SDL_CreateWindow() is allocating its own copy.