Merge "Fix recovery of stats data from previous input while using ProtoOutputStream" into pi-dev