Added quick check to flush() that returns immediately if txbuf_len=0