openai_poll_batch_until_complete function

Poll an OpenAI batch until it completes or fails