ensure output writer is flushed, duh