fix data races in controller

Fix #305
close() itself could be used as [a way of boradcast](http://talks.golang.org/2012/10things.slide#11) which is idiomatic to Go.

Writing a value to the channel does not work, because it can only be checked once. On the other hand, a closed channel would work because it is always readable. So a closed channel could be used to indicate some condition, similar to sync.Cond.