Fix Linux build.

Add missing include files and remove outdated functions from OS-specific code.
Instead of putting a dummy unistd.h on the include path, disable its inclusion the right way.