Explicitly close read and write of Popen to latex

This avoids a warning in the test suite on python3.4. When reading
and writing from directly from stdout and stdin of the process they
should be explicitly closed afterwards.
Close framesink in non file based animation too.
Merge pull request #3309 from jenshnielsen/close_files_pgf

MNT : Explicitly close read and write of Popen process (latex)