Performance improvements to event tracing.

* Avoid CopyOnWriteArrayList iterator construction (use a simple
  array and iterate over that) for event hook list
* Use int[] to represent line number hit counts.
* Fix int[] size checking to avoid excessive allocation.
* Fixes to trace correctly in compiler without Backtrace.