Fix fs_write to allow writing null bytes