Refactor r_debug_pid_list() a bit