Visual Studio does not come with unistd.h, but Windows do have write() and
close() in io.h, so include io.h instead of unistd.h on Windows.
For MinGW, unistd.h in turn includes io.h.
Unify the many copies of diff_with_file in one source
file, and patch it to detect diff at runtime and fall
back to a simple strcmp if we don't have it. Make all
tests use this new testutils.c, and stop requiring
diff for building the tests.
This should let us allow to build on Windows with the
default value for -Dbuild-tests.