debug: Remove thread-related code from debug.c