__io_uring_submit_and_wait: check for SQ readiness for submit == 0

We could still have entries to submit even though we didn't flush
any, if we previously tried to submit and failed or just submitted
fewer than we had hoped.

Adds a helper, io_uring_sq_ready(), which returns how many entries
are in the SQ ring that the kernel hasn't consumed yet.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
2 files changed