Support gzip and bzip2 compression for StateDataReporter (based on filename
extension). Users were already able to pass gzip.GzipFile objects and
StateDataReporter would write compressed data. bz2.BZ2File objects also worked
after I removed the self._out.flush() calls.