sound: Fix crash with large values of snd_channels.

Sanity check the handles passed to the i_sdlsound.c API functions and
ignore requests that involve channel numbers higher than 15. This
fixes a crash if the user sets the snd_channels config variable is set
to a high value. This fixes #149 (thanks Alexandre Xavier).
midifile: Fix portability issue with malloc(0).

In the C standards, malloc(0) may return NULL without indicating a
failure to allocate. As values read from the MIDI file may be
arbitrary, add one to the allocated length so that we always allocated
a positive value. This fixes #165 (thanks nmain).