shell: fix missing cleanup in "perf stat"

Our "perf stat ..." shell command installs a tracepoint counter
(implemented by the com.cloudius.trace.Counter) but neglects to
close() it when done.

So when the "perf stat" command is interrupted, the counter is left
behind, causing a waste of time at best (as we keep counting the tracepoint
even when perf stat is not running) - and a crash at worst (when
a GC frees the counter object, the kernel continues to count in it).

So this patch adds the missing close() calls in a "finally" section.
This "finally" is called when the perf stat command is interrupted
with a ^C.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>