fix deadlock in NewWriterSingle