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.
Merge pull request #1119 from dorkster/fixes

Fix some bugs discovered with Coverity