Limit loop measurements to RECORD_THRESHOLD.

Some loops are called so many times that even trivial instrumentation such as
incrementing a variable and an occasional function call make the overhead shoot
high. This patch limits the number of measurements for any given loop
(identified by the function address and line number) to the RECORD_THRESHOLD
value. Further measurements are ignored.