[gdb/testsuite] Check compilation result in gdb.base/structs.exp
When running test-case gdb.base/structs.exp with target board unix/-bad, I
get:
...
gdb compile failed, gcc: error: unrecognized command line option '-bad'
UNTESTED: gdb.base/structs.exp: failed to prepare
ERROR: tcl error sourcing src/gdb/testsuite/gdb.base/structs.exp.
ERROR: can't read "use_gdb_stub": no such variable
...
Fix this by checking the compilation result.
Fix the resulting DUPLICATEs using with_test_prefix.
Tested on x86_64-linux.