Add more commented patch numbers to version.c (3) #940

This should help reduce conflicts when merging patches from upstream.
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'
travis.sh: Fix mixed tabs/whitespace formatting.
travis.sh: Use dependencies from neovim/deps.
travis.sh: Simplify clang/asan build.

* Clang 3.4 now default on Travis CI.
* Introduce config variable to download & use different clang version.
Merge #947 'Remove Clang 3.4 installation in travis.sh.'
Import mingw-w64 cmake toolchain settings
Add support for the PDCurses curses library

- Public Domain Curses is a curses compatible library that runs
  on windows
Picked: Refactor declaration generation

- Call compiler from CMake instead of lua script to generate a
  preprocessor file - allows for better/early error detection if
  the compiler fails
- Preprocessor files are saved along with the headers as .i files
- Accept preprocessor lines with trailing chars after # as is
  the case in Clang/Windows
- The fourth argument to gendeclarations.lua is now the path to
  the proprocessor output file
Fatal errors for setenv/lstat only for UNIX
Define uid_t for windows
Mingw: Use POSIX compatible stdio

- There are some differences between stdio (*printf) functions in POSIX
  and the MS runtime, this commit enables Mingw compatibility for these
  functions
Merge os_unix_defs.h into os/unix_defs.h
Hide away os_unix.c/ into os/deprecated

- In preparation to add support for multiple systems os_unix.c now lives
  in nvim/os/deprecated/
- nvim/os_unix.h still exists but only to keep things working
- Later the following should take place
  + nvim/os/deprecated/os_unix.c should be split among os/*.c files
  + nvim/os_unix.h should be removed
  + No file should include nvim/os_unix.h
Include winsock2.h in win_defs.h

- Mingw warns the include must show up before windows.h
Add stdio.h to win_defs.h
Add time.h to win_defs.h
Add path length defines to win_defs.h