Update berrystats.py

Just one small tweak: use a `with` block instead of manually opening and closing the file.
I don't have a Raspberry Pi, but it should work.