Temporary os_mkdtemp implementation. Use it instead of mkdtemp.
Remove HAVE_MKDTEMP

For now we provide simple `mkdtemp` for Windows, in the future we will
use libuv for that.
Remove USE_TMPNAM

tmpnam() is deprecated.
Remove #ifdefs TEMPDIRNAMES and add TEMPDIRNAMES for Windows

Vim does not define TEMPDIRNAMES for all systems, but it is defined for
all systems supported by Neovim.
Temporary directory names for Windows was obtained from GetTempPath()
function documentation at MSDN.
Additionally small renamings were performed.
Refactor vim_tempname

- temp_count is uint32_t now instead of long because it supposed to be
  at most 999999999 (comment on line 5227) temporary files. The most
  probably it was a long for compatibility with systems where int is
  16-bit.
- Use "nvim" as prefix for temp folder name instead of "v"
- Remove unused parameter from vim_tempname
Add vim_gettempdir(), remove global vim_tempdir

vim_gettempdir() and vim_maketempdir() was extracted from
vim_tempname().
Extract `tempfile` module from fileio

Though this module is relatively small it has very clear boundaries.
The last argument for extracting `tempfile` was the errors which I got
when I was writing unittests for it: `cimport './src/nvim/fileio.h'`
does not work for some reason.
tempfile.c: add tests
tempfile.c: add to clint-files and fix warnings
tempfile.c: enable -Wconversion
tempfile.c: fix style issues and comments
tempfile.c: refactor vim_settempdir

- return result of setting and remove directory if the setting was not
  successful.
- don't do `STRCPY` in case of `vim_FullName` failure because
  `vim_FullName` already did it.
Create os/os_defs.h for os specific definitions
Merge #850 'impl mkdtemp for windows, refactor vim_tempname'
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'