Fix windows build error due to missing unistd.h and access(). If permissions
are not ok it will throw an error later in parse_file(), so the check is not
needed here.
Fix for building against an older gcc version (< 4.4).
Fix missing includes and math functions when building on windows with mingw
or visual studio. The math functions need #ifdefs because they are macros
on some platforms and functions on others.