Implement changes in #57: improve behaviour of dumped files

Here's a start on #57.
Questions:

1. When a file in read or append mode does not exists, the file currently points to os.devnull. Is this acceptable?
2. Do you think the test file is enough?
3. Should the IOErrors be replaced by UnpicklingErrors?
4. When the position is off the end of the file, in safe mode, should an exception be raised, or the position moved to the end?

Parallel computing in python has taught me over the years to put the import inside the function, regardless. I do not believe it should be required in this case, so no.