Add cmake platform checks

- Defined CMake checks for all headers in config.h.in
- Removed headers checks that are not used anymore:
  sgtty.h sys/statfs.h libintl.h poll.h
- Added UNIX check
- Add some fatal checks
  + Check for setenv() and fail if it does not exist
    since our os layer just assumes it does
  + lstat is required by os_unix.c
  + sys/wait.h is required in UNIX
- Removed entries for functions that are not being used: getcwd,
  getrlimit, getwd, nanosleep, sigaltstack, getwd, sigstack, fseeko
- Replaced nearly all defines in config.h.in for functions with
  compile time checks
- Add check for symbol FD_CLOEXEC
- Add check for langinfo CODESET
- HAVE_ICONV_H and HAVE_ICONV hold the expected checks but Neovim uses
  USE_ICONV define to actually decide whether to enable it
- Removed checks that are no longer needed
  + USEMEMMOVE
  + _FILE_OFFSET_BITS
  + HAVE_ST_BLKSIZE
  + dlfcn.h
Clean up DEBUG check in config.h.in
Merge #813 'Add platform checks to replace config.h.in hardcoded values'