Chan uses std::condition_variable

github issue #27
In a way, it fixes a bug too