gdb/testsuite: Remove duplicates from gdb.base/realname-expand.exp
When running the testsuite, I have:
Running .../gdb/testsuite/gdb.base/realname-expand.exp ...
DUPLICATE: gdb.base/realname-expand.exp: set basenames-may-differ on
This is due to the fact that the test restarts GDB twice and each time
sets the basenames-may-differ setting. This patch proposes to fix this
by not restarting GDB so the setting is maintained. It just clears the
breakpoints between the two tests and updates the breakpoints number as
required.
This patch also perform some minor refactorings to improve visibility.
Tested on x86_64-linux.