Alt-F4: quit the emulator.

When SDL is running without windowing system, there's nothing that
will generate a SDL_QUIT event. So we need to provide a way to stop
the emulator. Fixes #4.
Simplify scaling code a bit