Thread leak-detection and clean up

MSP-11147

# Verification Steps