Adding a json dump for the stats

I added a json serializer for the stats. That will ease the implementation of a stat api in scrapyd.