I don't see threads being used anywhere in your script, it uses Parallel::ForkManager.
The "free to wrong pool" error may be a Windows related bug in Parallel::ForkManager, since on Windows, forks are emulated with threads. But you are the first I've seen reporting that as a thread-related problem running it with Tk.