replace writer.Close() with write.close()

1. close(this.exitChan) in writer.close()
2. replace Mutex with transactionStat