Move shared mutex and cond from global to per-writer.