Add a hook to zk TestServer for use in tests.
Expand lock to avoid race in RebuildShard.

Lock before reading topo, to prevent another rebuild from writing
fresher data that could then be overwritten with stale data by a slow
rebuild.
Merge pull request #145 from youtube/rebuild

Expand lock to avoid race in RebuildShard.