Changes to stats output

Truncate file when logshifter starts, instead of before writing each
stats interval.

Output JSON instead of multiple lines per interval.