send(), don't flush()

Also, catch an IndexError in case the pipeline is empty.