gdb: fix thread debugging