gdb/testsuite: use with_cwd where possible

I learned about with_cwd today.  I spotted a few spots that could use
it, to make the code more robust.

Change-Id: Ia23664cb827f25e79d31948e0c006a8dc61c33e1
8 files changed