iterating over stdout blocks without .readlines()