Backport mstorjo's changes to wavreader.c

These include commits:
f825104 Add support for waveformatex files
16f75a5 Support reading sox style piped wav files
43cb942 Use skip instead of fseek
cb19aa7 Allow reading wav files with a 0 bytes RIFF chunk
3951d0a Allow opening stdin when "-" is specified
e7348e7 Support streamed wav files with a 0 bytes data chunk