[server] correct usage of g_strndup

  - g_strndup will always allocate a n+1 bytes string, and terminate it by NULL.
  - there is no need for manually doing this.
  - see more at glib's source (glib/gstrfuncs.c)
  - see more at glib's document
    https://developer.gnome.org/glib/2.28/glib-String-Utility-Functions.html
Merge pull request #703 from Chilledheart/correct_usage_of_g_strndup

[server] correct usage of g_strndup
fixed strftime on win32 server, Closes haiwen/seafile-client#134
Merge pull request #710 from haiwen/fix-win-strftime

fixed strftime on win32 server, Closes haiwen/seafile-client#134
Add CMake Build System
test: Add the missing argument for read_index_from
Skip deprecated g_type_init() for GLib 2.36
httpserver: bm->size >= 0 is always true

    In struct _BMetadata, size is unsigned.
    No need to check if bm->size >= 0
Silence compiler warning

   silence the warning of uninitialized head_id in putcommit-v2-proc.c
   silence the warning of implicit declaration of g_open in test-seafile-fmt.c
   silence the warning of implicit declaration of g_stat in test-cdc.c
   silence the warning of uninitialized e in merge-recursive.c
[TODO]update test_write_chunk to support new version of WriteblockFunc
Eliminate goto in compute_repo_size of size-sched.c
Eliminate bad whitespaces in task.vala
Replace gnome-terminal with bash in test scripts
FIX for homebrew
[FIX] Add -liconv for homebrew build