avoid using thread local storage for thread index

It is cheaper to get thread index from vlib_main_t if available...

Change-Id: I4582e160d06d9d7fccdc54271912f0635da79b50
Signed-off-by: Damjan Marion <damarion@cisco.com>
diff --git a/src/vnet/ip/ping.c b/src/vnet/ip/ping.c
index a929a0c..096b2eb 100755
--- a/src/vnet/ip/ping.c
+++ b/src/vnet/ip/ping.c
@@ -577,7 +577,7 @@
   pool_get (pm->ping_runs, pr);
   ping_run_index = pr - pm->ping_runs;
   pr->cli_process_id = curr_proc;
-  pr->cli_thread_index = vlib_get_thread_index ();
+  pr->cli_thread_index = vm->thread_index;
   pr->icmp_id = icmp_id;
   hash_set (pm->ping_run_by_icmp_id, icmp_id, ping_run_index);
   for (i = 1; i <= ping_repeat; i++)