gdb/testsuite: resolve duplicate test names in gdb.threads/tls.exp

While running the gdb.threads/tls.exp test with a GDB configured
without Python, I noticed some duplicate test names.

This is caused by a call to skip_python_tests that is within a proc
that is called multiple times by the test script.  Each call to
skip_python_tests results in a call to 'unsupported', and this causes
the duplicate test names.

After this commit we now call skip_python_tests just once and place
the result into a variable.  Now, instead of calling skip_python_tests
multiple times, we just check the variable.

There should be no change in what is tested after this commit.
diff --git a/gdb/testsuite/gdb.threads/tls.exp b/gdb/testsuite/gdb.threads/tls.exp
index 486e29d..4f88c0e 100644
--- a/gdb/testsuite/gdb.threads/tls.exp
+++ b/gdb/testsuite/gdb.threads/tls.exp
@@ -72,7 +72,7 @@
 	    "= $expected_value" \
 	    "${number} thread local storage"
 
-    if {![skip_python_tests]} {
+    if {!$::has_python_support} {
 	gdb_test_no_output \
 	    "python sym = gdb.lookup_symbol('a_thread_local')\[0\]" \
 	    "${number} look up a_thread_local symbol"
@@ -155,6 +155,9 @@
 
 clean_restart ${binfile}
 
+# Set this to avoid calling skip_python_tests repeatedly.
+set has_python_support [skip_python_tests]
+
 gdb_test_multiple "print a_thread_local" "" {
     -re -wrap "Cannot find thread-local variables on this target" {
 	kfail "gdb/25807" $gdb_test_name