Have you tried it with other avi files? The audio track of the file might be longer than the video track (just a guess).
Have you tried the -t option?
Restrict the transcoded/captured video sequence to the duration
specified in seconds. "hh:mm:ss[.xxx]" syntax is also supported.
You may want to try setting an audio bit stream filter in ffmpeg. I've never tried it but the "remove_extra" filter sounds promising ;)
Bitstream filters available are "dump_extra", "remove_extra",
"noise", "mp3comp", "mp3decomp".
Have you considered using a command like ExifTool to view information about the file and setting your options accordingly (perhaps even parsing the output & automating it in your script)?
Perhaps you could extract the audio file in a lossless format and then transcode the audio file but there has to be a better way than that.
If you get it sorted please do post what you've done because I'm not satisfied with the obvious methods of processing the 1000's of video files I need to demux. I've made a script similar to yours, however I want to get the best possible quality audio files I can without wasting any space. My transcoding options will be dynamic for sure so I need something a little more sophisticated than a one liner.