better iteration over stdin in smr-reduce