properly stops the thread that streams data from agda to output panel