Fix FindLibUV libname for MSVC
Fix FindMsgpack libname for MSVC
Fix FindLuaJit libname for MSVC
Fix FindPDCurses.cmake libname for MSVC
Fix declaration generation for MSVC compiler

(cherry picked from commit 276a51e9e29f5493f03038337f876ee3bdf5cb4e)
Add header guards for sys/time.h and unistd.h

- On MSVC there are no sys/time.h and unistd.h
Disable incompatible compiler flags for MSVC
Add compiler flags for MSVC
Add MSVC defines for __func__, restrict, inline
FindLibIntl: Only link iconv link Mingw
Find LibIntl for MSVC

- Use the right lib name for MSVC
- Make libintl required for MSVC
Add STDOUT_FILENO define for MSVC
FIXME: No VLA in MSVC
MSVC does not support designated union initialisers
Add MSVC cmakedefine
MSVC: define W_OK
Pack up MSVC bits in win_defs.h
Add MSVC defines for fs S_ISREG/ISDIR, S_IXUSR
Add MSVC define for STDERR_FILENO
Only link against -lm in UNIX