send the filename instead of file object.
send the filename instead of file object.
Send the filename to the plot object

Now the plot object opens and closes the file, if sent. This simplifies
many things.  There are no longer race conditions between the open file
and the plot object, since the plot object handles everything.

Also for python 3 there is no way to get a FILE* from an input python
file object.  So this should also make it possible to move to python3
without any difficulties.  For python3 we still need to worry a bit
about encoding, but we can approach that later.