fix write to closed channel error

w.Write after w.Stop() will return err