Added simple dot_product example.
Fix data race. A thread might not have finished it's A[tid]*A[tid]
computation before the reduction starts.