Fix return value of AudioBuffer::write