added check in fs_write for NULL block; this fixed a segfault on Windows and Ubuntu when linking (OSX was fine?!)