[net] fix utf-16 issue under win32
Merge pull request #60 from Chilledheart/patch-1

[net] fix utf-16 issue under win32
[build] add cmake build system

 - add missing includedir for cmake
 - remove shared library version
Resolve pidfile resource leaks

This patch resolves resource leaks caused by not closing the file streams upon
an write error.
[lib] removal of unused code
[net] Add role for user

  - fix a issue with search_emailusers
  - fix bad memory usage
  - add id column for mysql
  - returning role string is not NULL string now
[build] correct sed usage