redo fix to FileWriter.write to only check the queue length if ret is false