This commit adds TM_BEGIN / TM_ENDS before and after spawning threads in
kmeans. This is (maybe?) needed to distribute the value of global_delta.