debuginfo: Make limited-debuginfo test case more robust against GDB output variations.

Fixes issue #12787.