Update wav_writer.py

this fixes the threading issue. onwards!