Add cmake platform checks

- Created a cmake/PlatformChecks.cmake to hold the checkes
- Added a check for mkdtemp
- 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
- For sys/wait.h I've added a fatal error if it is not
  found on UNIX
- Added UNIX check
- Also check for setenv() and fail if it does not exist
  since our os layer just assumes it does
Add cmake platform checks for functions

- Replaced nearly all defines in config.h.in for functions with
  compile time checks
- Fail if lstat is not present since os_unix.c requires it
- Removed entries for functions that are not being used: getcwd,
  getrlimit, getwd, nanosleep, sigaltstack, getwd
- Some checks were not unfixed since they need further investigation:
  iconv, tgetent, select,
Add a couple of missing checks

- Removed define for sigstack()
- Add check for fseeko()
- Add check for symbol FD_CLOEXEC
Remove USEMEMMOVE from config.h.in
Fix CMake checks for iconv

- This commit does not enable iconv usage, it is still off by default,
  but we should now be able to turn it on by setting USE_ICONV
- 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 for sys/select.h

- Commented HAVE_SELECT and removed SYS_SELECT_WITH_SYS_TIME
  from config.h.in
- Removed include for sys/select.h from vim.h