Asynchronous unloading of programs and waves

It is now possible to unload programs and waves without brutally
killing all voices. Unloading is now also safe with realtime
substates; a scenario that was previously ignored, with segfaults
waiting around the corner.

Details:

Removed ignored return codes from the Process() callback in audio
drivers. (There is a2r_Error() now.)

Added a per state event queue for things that are to be handled
at the end of the engine process cycle.

Added a2_WhenAllHaveProcessed() (internal API), which schedules a
callback to be called when the specified state and any related
states have completed at least one engine cycle.

Removed the awful a2_InstaKillAllVoices() hack.

Added a2_KillVoicesUsingProgram() (internal API) that is now used
instead of killing everything when a program is unloaded.

Added a2_LockAllStates() and a2_UnlockAllStates() internal APIs,
that lock the specified state, and any states related to it.

When waves are unloaded, the A2_wave struct is now left around,
marked with a wave size of 0, so that any oscillators using it can
switch off as they see it. (There is also logic to free the
A2_wave once all states have processed, but that's disabled for
now, as it's not entirely reliable. That is, the A2_wave structs
are leaked.)

Added waveupload.c example. (Uploads and plays a wave the easy
way, unlike streamupload.c, which does it the "hard" way.)

Added stress tests wavestress.c, wavestress2.c and voicestress.c.
(The latter two demonstrate issues covered by issue #117.)

Closes #114.