Disable optionally safe test hook in threading builds

Signed-off-by: Janos Follath <janos.follath@arm.com>
diff --git a/library/bignum_core.h b/library/bignum_core.h
index ff6360b..cf6485a 100644
--- a/library/bignum_core.h
+++ b/library/bignum_core.h
@@ -817,7 +817,10 @@
                                     mbedtls_mpi_uint mm,
                                     mbedtls_mpi_uint *T);
 
-#if defined(MBEDTLS_TEST_HOOKS)
+/*
+ * Can't define thread local variables with our abstraction layer: do nothing if threading is on.
+ */
+#if defined(MBEDTLS_TEST_HOOKS) && !defined(MBEDTLS_THREADING_C)
 extern int mbedtls_mpi_optionally_safe_codepath;
 
 static inline void mbedtls_mpi_optionally_safe_codepath_reset(void)