We need to call csync_commit in every error cases

Else there will still be outdated tree in the memory and the further sync
will be confused

Relates to #1710