stats: allocate shared memory for stats

This allows forked processes to write to stats and have their parent see the
updates.