gdb: fix thread debugging

This fix solves the gdb thread debugging problem on OE.
lto simply strips the "ps_pd*" functions in gdb, which are necessary to debug threads.
In addition, it's one of the reasons for "warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available."