Make cluster_config file and config in log consistent.

1. Write to cluster_config first then append to log in sync processor.
2. Clean up invalid cluster_config files after synchronization in case
the cluster_config has been truncated in log and recovering from log in
case the Zab crashed between writing to cluster_config and appending
to log (it's not likey though).
Merge pull request #183 from EasonLiao/cleanup_configs

write cop to a file before appending it to the log