Workaround for statistics memory leak

Statistics for consumer, producer and fetcher thread is leaking memory.
Added a switch as workaround for the problem. The statistics is off by
default.