gdb: parameterize all_threads_safe for the target and ptid 'all_threads' and 'all_threads_safe' are two range providers to iterate over threads. The former takes optional process target and ptid arguments to filter the threads that are being iterated. The latter does not. Enhance 'all_threads_safe' to also take the optional arguments. Use the new version of the function in two places. Approved-By: Simon Marchi <simon.marchi@efficios.com>