Ignore Emacs' .#* files

Emacs creates .#* files with and without a trailing # character
Adds a few missing system function checks

We were not checking for getpwuid_r(), getgrnam_r() or getgrgid_r().
Implements DEF_INCLUDE

Implements a new macro to add #define entries in config.h directly from
the CMakeLists.txt file
Implement OS detection
Adds more tests for users & groups functions