[gdb/testsuite] Check for valid test name

When running gdb.base/batch-exit-status.exp I noticed that the test name
contains a newline:
...
PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M
: No such file or directory\.: [lindex $result 2] == 0
...

Check for this in ::CheckTestNames::check, such that we have a warning:
...
PASS: gdb.base/batch-exit-status.exp: : No such file or directory\.^M
: No such file or directory\.: [lindex $result 2] == 0
WARNING: Newline in test name
...

Tested on x86_64-linux.
1 file changed