Fix concurrency issue in Engine when two goroutines compete to stop the
engine and also send at the same time.