[lldb-dap] refactor monitor thread in tests (#172879)

This patch fixes a timeout in the monitor thread of the
`test_by_name_waitFor` test.

Currently, if `self.attach` fails, the `spawn_thread` will never finish
and the test will eventually timeout after the 15mins timeout. We now
ensure that we always join the thread at the end of the test.

Additionally, this change also uses of the `spawnSubprocess` method to
create the process. This should ensure the process is always properly
cleaned up after an exception occurs.

GitOrigin-RevId: d8eec8e17a33693392448e314412c302e360daf3
2 files changed