Fix daemon mode in multiple programs under OSX

  - ccnet-server
  - ccnet

Same as the reason shown in https://github.com/haiwen/seafile/pull/726