Fix interval calculation bug in construct_report

construct_report function should now be safe and working.  Command
line testing shows it to function correctly.  It can process about
300 events per second, so large event queues will still be slow.

Major slowdown now seems to be in reading the sensor events in from
flash.  This is currently done 1 at a time so increasing the read
buffer will probably help.