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

1. re-setting this.exitChan in writer.close()