Fix potential memory leaks in helper.
Progressively collect data to prevent hang when data from autopkg exceeds NSTask/Python max buffer size.
more accurately reset values on scheduling error