Make WriteCommand goroutine safe