Correct replacing of log file

Do not leak resources in case of errors and ensure data is synced to
disk before replacing files.
fix(sync) leader should do a sync before committing log entires
As we do not fsync every time log writes to file when the state is leader, we need to do fsync before actually committing the log entries to ensure safety.
Save config file atomically
refactor(server.go) Leader do not need to send its own response of receiving a command to itself.
We send response to itself before, since it is a simple way to deal one machine cluster. After a little modification, we do not need to do this anymore.
do not make map twice
fix(logging): Fix malformed log statement
Merge pull request #153 from bcwaldon/fix-log-statement

fix(logging): Fix malformed log statement
Merge pull request #152 from xiangli-cmu/refactor_processCommand

Refactor process command
fix(util.go) make writeFileSynced return error properly
Merge pull request #150 from xiangli-cmu/sync_fix

Fix file issue
handle Snapshot and SnapshotRecovery requests in the http transporter
Merge pull request #154 from influxdb/http-transport-snapshot-support

handle Snapshot and SnapshotRecovery requests in the http transporter
Add Drone.io & Coveralls badges.
feat(event): Add HeartbeatEventType
Merge pull request #156 from bcwaldon/HeartbeatEventType

feat(event): Add HeartbeatEventType
Snapshot test coverage.
Merge branch 'master' of https://github.com/goraft/raft into snapshot-testing

Conflicts:
	snapshot.go
Fix cover profile location.
Merge pull request #157 from goraft/snapshot-testing

Add snapshot test coverage
fix(log_entry.go) reports the right read size(including the length field puls a newline char)