Replace all instances of ssize_t with long and rearranged unistd include, fixing compile errors on Windows VS.