make sure that gnuplot pipe is closed