Orchid: fix infinite task creation loop when shutting down
Orchid: better thread tracking

also, fix race condition in closing circuits on shutdown