Added terminate to PyplotViewer

To deal with situations when the main process is killed the
viewer needs to close all I/O and terminate the child process.