[ALSA patch] [PATCH 2/3 v2] pcm_file: improve error checking in write_wav_header function