[client] land new changes of new-sync for osx
Merge branch 'new-sync-osx' into 3.1
[client] make the compiler happy when compiling with -Wall flag
[client] Fix rename problem on Windows and Mac.

The case is that a file/dir's name changes in cases.