[client] Fix a few bugs in merge.

* Still update index entry if checkout file fails;
* Always clean when merge with an empty folder.