idle_analysis: Fix idle residency when idle events are sparse
idle_analysis: Fix idle residency when idle events are sparse

Consider a 5-second trace where a CPU goes idle at time 0.1 and remains
idle for the rest of the trace. In that case, the cpu_idle data frame
will appear to end at time 0.1. This means the idle state residency
reported for that CPU will be less than 0.1s, when in fact it was idle
for at least 4.9s.

Fix this by inserting an artificial event when calculating residencies
that duplicates the last event, with a time value as the end of the
trace's collection period.

credp/lisa,credp/lisa,credp/lisa,credp/lisa,ARM-software/lisa,joelagnel/lisa,mdigiorgio/lisa,mdigiorgio/lisa,bjackman/lisa,bjackman/lisa,arnoldlu/lisa,ARM-software/lisa,arnoldlu/lisa,joelagnel/lisa,ARM-software/lisa,ARM-software/lisa