Fix a major memory issue in the SumStats framework.

 - There are still problems, but this should prevent a deadlock issue
   and help with memory use.