implement wait command.

we need synchronous replication. see http://antirez.com/news/66 for details