Wouldn't something like this work? Just check for empty strings?
def read_loop():
while True:
chunk = r_stream.readline()
if not chunk: # Empty string = pipe closed
break
if chunk:
print('got chunk', repr(chunk))
got_chunks.append(chunk)