[Bro-Dev] #1002: Merge new thread cleanup code