tests: Don't use ptrace detach stopped trick. Raise can return.

On older kernels the ptrace detach stop trick doesn't work reliably.
Just keep the child processes attached and stopped during the tests,
dwfl_linux_proc_attach will handle that fine now. Also on older kernels
raise would sometimes return anyway and cause a spurious assert. Just
ignore it.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
diff --git a/tests/backtrace.c b/tests/backtrace.c
index 64f90c4..758dfed 100644
--- a/tests/backtrace.c
+++ b/tests/backtrace.c
@@ -260,15 +260,6 @@
 #define tgkill(pid, tid, sig) syscall (__NR_tgkill, (pid), (tid), (sig))
 
 static void
-ptrace_detach_stopped (pid_t pid)
-{
-  errno = 0;
-  long l = ptrace (PTRACE_DETACH, pid, NULL, (void *) (intptr_t) SIGSTOP);
-  assert_perror (errno);
-  assert (l == 0);
-}
-
-static void
 report_pid (Dwfl *dwfl, pid_t pid)
 {
   int result = dwfl_linux_proc_report (dwfl, pid);
@@ -280,7 +271,7 @@
   if (dwfl_report_end (dwfl, NULL, NULL) != 0)
     error (2, 0, "dwfl_report_end: %s", dwfl_errmsg (-1));
 
-  result = dwfl_linux_proc_attach (dwfl, pid, false);
+  result = dwfl_linux_proc_attach (dwfl, pid, true);
   if (result < 0)
     error (2, 0, "dwfl_linux_proc_attach: %s", dwfl_errmsg (-1));
   else if (result > 0)
@@ -397,8 +388,6 @@
       prepare_thread (pid2, jmp);
     }
   dwfl_end (dwfl);
-  ptrace_detach_stopped (pid);
-  ptrace_detach_stopped (pid2);
   check_tid = pid2;
   dwfl = pid_to_dwfl (pid);
   dump (dwfl);