In !NDEBUG, remember which audio_format is stored in every chunk and every pipe. Check the audio_format of every new data block appended to the music_chunk, and the format of every new chunk appended to the music_pipe.
Moved some code from music_pipe_write() and music_pipe_expand(). Only music_chunk.c should access the music_chunk internals.