[server] fix mysql multiple id in get_emailusers
Merge pull request #62 from Chilledheart/patch-2

[server] fix mysql multiple id in get_emailusers
Fix SQL bug in get_superusers.
[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
[build] correct sed usage
[build] fix bus error while execute make -jN (N>1)

 - please use latest version of seaf-codegen.py,
    at least the one in haiwen/libsearpc#17