Simpleperf: fix a reference error in lambda function.

loop is a local variable, but the lambda function is used outside
its scope.

Bug: none
Test: test.py TestApiProfiler.*.
Change-Id: Ib09019706da001596af340b3909aef355f48cfb8
1 file changed