fix saving of data files. i believe might
be related to multiple threads (linux process
clones()) using the same errno.