32bpp fixes for compatibility with Emscripten SDL.

Calling SDL_SetColors() is unnecessary and wrong when there is
no palette. Also, colour component shifts need to be computed
instead of using SDL_PixelFormat fields that are for internal use
only.
Respect SDL surface pitch in 8 bpp mode.

Previously, code assumed that 8 bpp SDL surface pitch is equal to
width. It is not equal in Emscripten SDL. This fixes 8 bpp display
in Emscripten SDL. Code still requires 8 bpp surface pitch which
maintains alignment for 32 bit writes.
Set CFLAGS and CXXFLAGS to -O3 and allow overriding.

This changes optimization from -O4 to -O3. It has no effect with
gcc, because -O3 is the highest optimization level. It also sets
CFLAGS and CXXFLAGS using the method shown in the Autoconf manual.
This allows them to be overridden when running ./configure.
Fix for compiling without EsounD.
Fix warning in svgawrap.cc.

The dev parameter of mouse_init() is not declared as const,
so a const string shouldn't be passed to it.