The problem is that worker threads are not told to terminate. This becomes a problem if a connection is repeatedly opened and closed within a script.
Usually this isn't a problem because the device is opened just once per session and if the script terminates, any worker threads are automatically terminated.