Fix pipe flushing

Reading input in a while loop for unbuffered reading and flush the
output as soon as the result has been written. This way you can do
something like
curl localhost | python hashid.py | grep +
and analyze hashes as soon as first command spits them out