[gdb/testsuite] Fix test name in gdb.base/batch-exit-status.exp

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
...

The mistake is that I passed an output regexp argument to a parameter
interpreted as testname prefix.  Fix this by passing a testname prefix
instead.

Add support for checking output, to be able to handle the output regexp
argument.

Tested on x86_64-linux.
1 file changed